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

VB Script for saving excel file appending weekend's date to the filename

$
0
0
Hi,


Need assistance in creating VB script for saving an excel file that appends the weekending date.

Say my filename is "Week to date Sales for WE" + weekending date.

Where weekending date falls on a Sunday. For example date today is 26June2013, this falls on weekending 30June2013.

Below is a script saving a file in PDF that appends previous day's date, but I cannot figure out how I can show weekend date. :(


ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\My Documents\MyReports\Sales Reports\Daily Sales Report as of " + VBA.Strings.Format(Now - 1, "ddmmmmyyyy") _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True

Thank you in advance for your assistance. :)



Regards,


Alex

Viewing all articles
Browse latest Browse all 50103

Trending Articles