ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date re-format (https://www.excelbanter.com/excel-programming/288407-date-re-format.html)

Kevin

Date re-format
 
I need to append the current date-time into a string
without slashes ("/") or dots ("."), to use as a
filename. I have passed the Date function to a variable,
but can't easily convert the format without parsing the
string to remove the slashes. Is there an easy way to
convert it to the native numeric format Excel uses
internally (that would work fine, I just need a date
string to differentiate filenames), or any otehr format
that would work in a filename? There must be an
easier/faster way than parsing this.

thanks

kpd

Bob Phillips[_6_]

Date re-format
 
Kevin,

Try something like

sFileDate = Format(Date,"yyyymmdd")

and append that to the filename before saving

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Kevin" wrote in message
...
I need to append the current date-time into a string
without slashes ("/") or dots ("."), to use as a
filename. I have passed the Date function to a variable,
but can't easily convert the format without parsing the
string to remove the slashes. Is there an easy way to
convert it to the native numeric format Excel uses
internally (that would work fine, I just need a date
string to differentiate filenames), or any otehr format
that would work in a filename? There must be an
easier/faster way than parsing this.

thanks

kpd





All times are GMT +1. The time now is 10:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com