Aussie5380
New Member
- Joined
- Sep 30, 2022
- Messages
- 32
- Office Version
- 2019
- Platform
- Windows
Hi there,
Newish to Macros, and need a little help with a macro to save a copy of the workbook, but to have the save as dialog to pop up.
i currently have this, and have tweaked a little:
Sub allow_user_to_select_save_location()
ActiveWorkbook.Save
Selection = Application.GetSaveAsFilename( _
FileFilter:="Excel Macro-Enabled Workbook (*.xlsm), *.xlsm", _
Title:="Please Select Location to Save File", _
InitialFileName:="Name Here")
If workbook_Name <> False Then
ActiveWorkbook.SaveCopyAs Filename:=Name_Here
End If
End Sub
The issue im having is its not saving a copy of the workbook, it was only saving a copy of the calc sheet.
Is there a way i can have the entire work book saved with the save as dialog come up to choose where i want to save, and to save a copy of the entire workbook instead of just the sheet im working on. I'd also like it to not open the saved file once saved, and to not close the workbook after its saved (which im guessing the last line of code does?)
Any help would be greatly appreciated
Newish to Macros, and need a little help with a macro to save a copy of the workbook, but to have the save as dialog to pop up.
i currently have this, and have tweaked a little:
Sub allow_user_to_select_save_location()
ActiveWorkbook.Save
Selection = Application.GetSaveAsFilename( _
FileFilter:="Excel Macro-Enabled Workbook (*.xlsm), *.xlsm", _
Title:="Please Select Location to Save File", _
InitialFileName:="Name Here")
If workbook_Name <> False Then
ActiveWorkbook.SaveCopyAs Filename:=Name_Here
End If
End Sub
The issue im having is its not saving a copy of the workbook, it was only saving a copy of the calc sheet.
Is there a way i can have the entire work book saved with the save as dialog come up to choose where i want to save, and to save a copy of the entire workbook instead of just the sheet im working on. I'd also like it to not open the saved file once saved, and to not close the workbook after its saved (which im guessing the last line of code does?)
Any help would be greatly appreciated