spacetraveller
asked on
VBA Date character extraction
Hi
I want to include the date and time of file generation in the file name. How can I keep the mm, dd, yy, hh, mm, ss and delete the characters / and : from the general format mm/dd/yy hh:mm:ss ?
Thanks,
st
I want to include the date and time of file generation in the file name. How can I keep the mm, dd, yy, hh, mm, ss and delete the characters / and : from the general format mm/dd/yy hh:mm:ss ?
Thanks,
st
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Wowwie. Learn something new every day.
I use yyyymmddhhnnss so I can easily sort my files cronologically but that is just me ... format it however you would like :-)
ASKER
Thanks Jim Horn and Stevbe. now I know that I have to use "Format".
Thanks a lot.
st
Thanks a lot.
st
Format(Now(), "mmddyyhhnnss")
now add your base filename at the beginning and file extention at the end ... the function I posted makes this a bit easier for me as I have a number of file formats I export to.