jimmy2times
Board Regular
- Joined
- Aug 8, 2014
- Messages
- 69
Hello,
I have the following code
Sub CreateBackup()
'Step 1: Save workbook with new filename
ThisWorkbook.SaveCopyAs _
Filename:=ThisWorkbook.Path & "" & _
Format(Date, "mm-dd-yy") & " " & _
ThisWorkbook.Name
End Sub
The code is working correctly. However, I want to always save the workbook with monday's date from last week rather than today's date. So for example if I was running the code today I want to save the date as 19th November.
Is there a way I can get this code to save to the required date?
I am quite new to VBA so any help is appreciated.
Thank you
I have the following code
Sub CreateBackup()
'Step 1: Save workbook with new filename
ThisWorkbook.SaveCopyAs _
Filename:=ThisWorkbook.Path & "" & _
Format(Date, "mm-dd-yy") & " " & _
ThisWorkbook.Name
End Sub
The code is working correctly. However, I want to always save the workbook with monday's date from last week rather than today's date. So for example if I was running the code today I want to save the date as 19th November.
Is there a way I can get this code to save to the required date?
I am quite new to VBA so any help is appreciated.
Thank you