ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date format in macros (https://www.excelbanter.com/excel-programming/308254-date-format-macros.html)

dmg

Date format in macros
 
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


jordanctc[_14_]

Date format in macros
 
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

--
Message posted from http://www.ExcelForum.com


dmg

Date format in macros
 
I'll try that.
Thanks

"jordanctc " wrote:

Assuming datKey is set to the correct date or Now() then place this
after the folder at the end of the path in your save code

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

Jordan


---
Message posted from http://www.ExcelForum.com/




All times are GMT +1. The time now is 04:17 PM.

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