Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
date format changes when I save to CSV via a macro, but not manual brawlsadford Excel Discussion (Misc queries) 4 May 17th 07 09:43 AM
date format changes when I save to CSV via a macro brawlsadford Excel Programming 1 May 16th 07 02:06 PM
date format changes when I save to CSV via a macro John Taylor Excel Discussion (Misc queries) 4 May 16th 07 01:44 PM
save workbook as current date using a macro ExcelJon Excel Discussion (Misc queries) 2 June 21st 06 03:05 AM
Using macro to save as todays date Momo Excel Programming 5 January 26th 05 06:09 PM


All times are GMT +1. The time now is 08:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"