IIII
New Member
- Joined
- Jan 26, 2021
- Messages
- 18
- Office Version
- 365
- Platform
- Windows
- Mobile
- Web
Hi All - as it states in the heading, I'm looking to either amend the code below or obtain a new on where I can copy the workbook I have open to the same folder but with the Week ending date (Sunday) added to the end of the file name.
I found this code (Credit: @swapnilk) that gets me going into the right direction but I just need it to save and do the above without prompting. Hope this makes sense, otherwise please let me know if more info is required. Thanks all.
I found this code (Credit: @swapnilk) that gets me going into the right direction but I just need it to save and do the above without prompting. Hope this makes sense, otherwise please let me know if more info is required. Thanks all.
VBA Code:
Sub SaveCopy()
'Declare a variable to hold the current workbook
Dim wb As Workbook
'Set the variable equal to the current open workbook
Set wb = ActiveWorkbook
'Prompt the user for the location to save the copy of the workbook
Dim savePath As String
savePath = Application.GetSaveAsFilename( _
InitialFileName:=wb.Name, _
FileFilter:="Excel Files (*.xlsx), *.xlsx")
'Save a copy of the workbook to the specified location
wb.SaveCopyAs savePath
End Sub