Stretchwickster
Programmer
Hey people!
I have the following code which successfully copies a worksheet in one workbook to a different workbook. However, the newly copied version displays #NAME? for its values because they are calculated using another sheet from the source workbook. Is there a way to simply copy the values over (and not the formulas) whilst doing a sheet copy?
I know it is possible to do this when copying ranges by using the PasteSpecial command. However, the Worksheet PasteSpecial command doesn't seem to have the Paste parameter that I would normally use when pasting ranges.
Your help would be much appreciated!
Clive![[infinity] [infinity] [infinity]](/data/assets/smilies/infinity.gif)
Ex nihilo, nihil fit (Out of nothing, nothing comes)
I have the following code which successfully copies a worksheet in one workbook to a different workbook. However, the newly copied version displays #NAME? for its values because they are calculated using another sheet from the source workbook. Is there a way to simply copy the values over (and not the formulas) whilst doing a sheet copy?
I know it is possible to do this when copying ranges by using the PasteSpecial command. However, the Worksheet PasteSpecial command doesn't seem to have the Paste parameter that I would normally use when pasting ranges.
Code:
Public Sub Save_SheetToNewWB()
Dim SourceWB As Workbook
Dim NewWB As Workbook
Set SourceWB = ThisWorkbook
Set NewWB = Workbooks.Add
SourceWB.Worksheets("CalcSheet").Copy Before:=NewWB.Sheets(1)
Set NewWB = Nothing
Set SourceWB = Nothing
End Sub
Your help would be much appreciated!
Clive
![[infinity] [infinity] [infinity]](/data/assets/smilies/infinity.gif)
Ex nihilo, nihil fit (Out of nothing, nothing comes)