Hi
I have a workbook contains formulas and links with 2 Sheets named “Template” and “Data”
The following macro copy everything on Sheet “Template” to a new workbook
The worksheet being copied has VBA codes associated with it which
I do not want copied to the new workbook. How can I copy just the sheet
without the formulas , VBA code & links; i.e. copy only the Values and Formatting
Private Sub CommandButton1_Click()
Dim FN As String
FN = Application.GetSaveAsFilename(fileFilter:=”Excel Files (*.xls),*.xls”)
If FN = “False” Then
MsgBox “File Save Cancelled by User”
Else
Sheets(“Template”).Copy
ActiveSheet.UsedRange.Formula = ActiveSheet.UsedRange.Value
ActiveWorkbook.SaveAs Filename:=FN, _
FileFormat:=xlNormal, Password:=””, _
WriteResPassword:=””, _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close SaveChanges:=False
End If
End Sub
Thanks