Enter current date automatically in filename

G

Guest

Excel 2000
When saving a file in a Macro, I want to automatically insert the current
date in the file name.

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\John\My Documents\Books(DATE HERE).xls",
FileFormat:=xlNormal _
, CreateBackup:=False

Result: Books01/25/07.xls
 
C

CoRrRan

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\John\My Documents\Books" & Format
(Date,"yymmdd") & ".xls", FileFormat:=xlNormal

HTH, CoRrRan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top