Hi!
all my previous question I found answers on on this forum, but on the following question I couldn't find any related topics:
I'm trying to write a VBA code to copy paste 2 sheets of my workbook to a new book. So far no problem with VBA code below:
BUT...
all the CUBEVALUE and CUBEMEMBER formulas in the original workbook result as #NAME ? instead of the values in the new book.
Anyone an idea how to copy paste the sheet values and keep original layout and formats like hidden columns, conditional formatting etcetera?
Thanks a lot!
all my previous question I found answers on on this forum, but on the following question I couldn't find any related topics:
I'm trying to write a VBA code to copy paste 2 sheets of my workbook to a new book. So far no problem with VBA code below:
Code:
Sub Button1_Click()
With ThisWorkbook
.Worksheets("budget 1").Unprotect
.Worksheets("budget 1").Copy
ActiveSheet.Cells.Copy
ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteValues
.Worksheets("budget 2").Unprotect
.Worksheets("budget 2").Copy After:=ActiveWorkbook.Worksheets(ActiveWorkbook.Worksheets.Count)
ActiveSheet.Cells.Copy
ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteValues
.Worksheets("budget 2").Protect
.Worksheets("budget 1").Protect
End With
Application.CutCopyMode = False
End Sub
BUT...
all the CUBEVALUE and CUBEMEMBER formulas in the original workbook result as #NAME ? instead of the values in the new book.
Anyone an idea how to copy paste the sheet values and keep original layout and formats like hidden columns, conditional formatting etcetera?
Thanks a lot!