in Education by
Newbie here, I have a template sheet with a table containing formulas.At the end I want to press a button to create and copy-paste values from template sheet to the new sheet so here is what i got: Sub CreateSheet() Dim xName As String Dim xSht As Object Dim xNWS As Worksheet On Error Resume Next xName = Application.InputBox("Please enter a name for this new sheet ", "New Sheet") If xName = "" Then Exit Sub Set xSht = Sheets(xName) If Not xSht Is Nothing Then MsgBox "Sheet cannot be created as there is already a worksheet with the same name in this workbook" Exit Sub End If ActiveSheet.Copy after:=Sheets(Sheets.Count) Set xNWS = Sheets(Sheets.Count) xNWS.Name = xName End Sub Problem is I just want to Paste Values without any formulas from template sheet Thanks JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You could go for a solution that would create an empty sheet manually and use PasteSpecial with option xlPasteValuesto copy only values - but this would not copy the formatting. You could then use another PasteSpecial to copy the formatting. An alternative is to first copy the whole template as you do, including formulas, and add the following statement. It looks odd at first, but it converts all formulas into values. xNWS.UsedRange.Value2 = xNWS.UsedRange.Value2

Related questions

0 votes
    Newbie here, I have a template sheet with a table containing formulas.At the end I want to press ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 6, 2022 in Education by JackTerrance
0 votes
    Newbie here, I have a template sheet with a table containing formulas.At the end I want to press ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I have 7 excel sheets in one workbook and I am trying to copy and paste the data from each excel ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    The formula in cell A2 is B2+C2. If we copy this formula to cell A4, what will be the new formula? Select the correct answer from above options...
asked Dec 25, 2021 in Education by JackTerrance
0 votes
    with the help of _____ option we can save another copy of the picture with the another file name ?a. save as b. open c. new d. exit Select the correct answer from above options...
asked Dec 12, 2021 in Education by JackTerrance
0 votes
    Which flag of PhoneGap CLI is used to copy an existing project while using create? (1)None of the options (2)--copy (3)--cp (4)--src (5)--copy-from...
asked Nov 30, 2020 in Technology by JackTerrance
0 votes
    In one Google sheet workbook, lets say I have Sheet1 with 5 rows as Sheet1 And I have Sheet2 as ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 6, 2022 in Education by JackTerrance
0 votes
    How to read an excel sheet and put the cell value within different text fields through UiPath? I have a excel ... help me out please? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    Layer is like transparent sheet that can hold objects and are stacked on top of each other, it is useful ... elemants of your movies Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    Mr.Iyer is an Accountant. He normally has to make balance sheet, profit and loss statements etc that need ... easily and effectively? Select the correct answer from above options...
asked Nov 30, 2021 in Education by JackTerrance
0 votes
    Sheet reference uses sheet name,__________, and cell address. Exclamation Mark Operator Dollar Sign Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    I have an xlsx file with 4 Sheets. Using the code below I am able to export the first sheet only ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    18F-AV-1451-A07 Value refer to another sheet called "CONTENT" in which column "B" and row "3". ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
...