Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save Macro with date in name
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save Macro with date in name
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
date format changes when I save to CSV via a macro, but not manual | Excel Discussion (Misc queries) | |||
date format changes when I save to CSV via a macro | Excel Programming | |||
date format changes when I save to CSV via a macro | Excel Discussion (Misc queries) | |||
save workbook as current date using a macro | Excel Discussion (Misc queries) | |||
Using macro to save as todays date | Excel Programming |