Output to filename with datestamp?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database that I need to save a file as an xls document. It works
fine but I hoped to have the filename be name + systemdate.xls. I can get it
to be name.xls which overwrites each time. Is there a way to set up this
macr so that it will append date() to the filename?
 
set the filename = Left(Date$, 2) + Mid(Date$, 4, 2) + Mid(Date$, 9, 2) +
".xls"
 
Or

NewFileName = FileName & Format(Date(), "ddmmyyyy") & ".xls"

Or

NewFileName = FileName & Format(Date(), "mmddyyyy") & ".xls"

Or..... many other options.
 

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