Filename with date and time

  • Thread starter Thread starter Alan
  • Start date Start date
A

Alan

Friends,

The below portion of a macro saves a file with the current
date as part of the file name in the format:
Voyager 5-Oct.xls

ActiveWorkbook.SaveAs Filename:= _
"H:\Reporting\Voyager " & Format(Date, "d-mmm") & _
".xls"

I want to modify the macro so it also saves the file with
the current date and also the current time, in the
something like the format:
Voyager 5-Oct 12_08 pm.xls

How would I do this?

Thanks,
Alan
 
ActiveWorkbook.SaveAs Filename:= _
"H:\Reporting\Voyager " & Format(Date, "d-mmm") & _
format(time,"_hh AM/PM") & ".xls"
 
Hi
try
ActiveWorkbook.SaveAs Filename:= _
"H:\Reporting\Voyager " & Format(Now, "D-MMM hh_mm") & _
".xls"
 

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

Back
Top