Hi again,
I'm using the following code (from another site) to copy the contents of a worksheet, paste it into a new worksheet and save it. Problem is, it's maintaing the links back to the old workbook, if that is saved, as my users will definitely do I tell them not to, then the values in the saved file will change.
I need to somehow add a 'Paste Special - Values' command into the below somehow, any help greatly appreciated!
Private Sub CommandButton1_Click()
Dim bk As Workbook
Dim fName As Variant
ActiveSheet.Copy
' creates new workbook
Set bk = ActiveWorkbook
fName = Application.GetSaveAsFilename( _
FileFilter:="Excel Files (*.xls), *.xls", _
Title:="Specify Location for Copy:")
If fName = False Then
' user has chosen cancel
' so delete the copy
bk.Close Savechanges:=False
Else
bk.SaveAs fileName:=fName
bk.Close Savechanges:=False
End If
End Sub
I'm using the following code (from another site) to copy the contents of a worksheet, paste it into a new worksheet and save it. Problem is, it's maintaing the links back to the old workbook, if that is saved, as my users will definitely do I tell them not to, then the values in the saved file will change.
I need to somehow add a 'Paste Special - Values' command into the below somehow, any help greatly appreciated!
Private Sub CommandButton1_Click()
Dim bk As Workbook
Dim fName As Variant
ActiveSheet.Copy
' creates new workbook
Set bk = ActiveWorkbook
fName = Application.GetSaveAsFilename( _
FileFilter:="Excel Files (*.xls), *.xls", _
Title:="Specify Location for Copy:")
If fName = False Then
' user has chosen cancel
' so delete the copy
bk.Close Savechanges:=False
Else
bk.SaveAs fileName:=fName
bk.Close Savechanges:=False
End If
End Sub