Darren_workforce
Board Regular
- Joined
- Oct 13, 2022
- Messages
- 146
- Office Version
- 365
- Platform
- Windows
Hello,
My macro file generates a new worksheet and at the end, it saves the file to my work desktop. I am currently renaming the file and adding the date in manually. I'd love to incorporate the prior Monday's date as well if that's possible just to shave off a few steps before I need to send the data to my superiors.
Today's date is 6.6.2023 and last Monday was 5.29. If I were to run the file today, preferably the filename would be "Attendance Report week of 5.29.2023". Below is what I have setup now. And I won't always run the report on a Tuesday so regardless of the weekday I run it, the results should still be the previous Monday.
All help would be greatly appreciated.
My macro file generates a new worksheet and at the end, it saves the file to my work desktop. I am currently renaming the file and adding the date in manually. I'd love to incorporate the prior Monday's date as well if that's possible just to shave off a few steps before I need to send the data to my superiors.
Today's date is 6.6.2023 and last Monday was 5.29. If I were to run the file today, preferably the filename would be "Attendance Report week of 5.29.2023". Below is what I have setup now. And I won't always run the report on a Tuesday so regardless of the weekday I run it, the results should still be the previous Monday.
All help would be greatly appreciated.
VBA Code:
ActiveWorkbook.SaveAs Filename:="C:\Users\darren\desktop" & fName & "\Attendance Report week of " & ".xlsx" _
, FileFormat:=xlWorkbookDefault, CreateBackup:=False