From: RD on 16 Apr 2010 00:49 Hi, I have a macro that I want to complete by saveing the file with the current date ate the end of the file name. I have this code but I get an error with the "DateAdd". ActiveWorkbook.SaveAs Filename:="Monthly Accrual Upload" & DateAdd ("MMMM") & " - " & DateAdd ("yyyymmdd") & ".xls", _ FileFormat:=xlText, CreateBackup:=False How can I get the file name for April to be; Monthly Accrual Upload - APRIL - 20101604 Thanks Rick
From: Jacob Skaria on 16 Apr 2010 01:10 Use Format() as below Msgbox "Monthly Accrual Upload - " & Format(Date, "MMMM - YYYYDDMM") -- Jacob (MVP - Excel) "RD" wrote: > Hi, > > I have a macro that I want to complete by saveing the file with the current > date ate the end of the file name. > > I have this code but I get an error with the "DateAdd". > > ActiveWorkbook.SaveAs Filename:="Monthly Accrual Upload" & DateAdd ("MMMM") > & " - " & DateAdd ("yyyymmdd") & ".xls", _ > FileFormat:=xlText, CreateBackup:=False > > How can I get the file name for April to be; > > Monthly Accrual Upload - APRIL - 20101604 > > Thanks > Rick >
|
Pages: 1 Prev: Execute a variable as an insertion into a VBA code line Next: grouping |