Date format in macros

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

Guest

Hi
I am a novice trying to use the date in a filename (e.g. Dave20040827.xls)
The only format I can get the date in is 8/27/2004 which causes issues with
my file path.
How can I change the date format in VB?
Any suggestions would be appreciated.
Thanks
 
Assuming datKey is set to the correct date or Now() then place thi
after the folder at the end of the path in your save code

"Dave" & Format(datKey, "YYYYMMDD") & ".xls"

Jorda
 

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