Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50139

VBA Save a file with filename and last Sundays date.

$
0
0
Hi
This is what I have in my macro which saves the file as Weekly Graphs20121204.xlsx (today's date)

ActiveWorkbook.SaveAs Filename:= _
"X:\11 Reporting and Analytics\Weekly Graphs" & Format(Date, "yyyymmdd") & ".xlsx"
Application.DisplayAlerts = True

What I would like to do is save it with the previous Sunday date so in this case I would want it to save as Weekly Graphs20121202.xlsx

Can anyone advise how I can do this?
Thanks in advance
Shaz

Viewing all articles
Browse latest Browse all 50139

Trending Articles