Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I turn Date into custom text? 1

Status
Not open for further replies.

jmy32

IS-IT--Management
Nov 17, 2005
3
US
Using Excel 2003, writing custom VBA code for a userform. I want to be able to create a custom filename to save a workbook by appending the date and time (unique and easy to identify).

I can't seem to figure out how to do it in VBA. The formula in Excel isn't working.

My goal is to have it such as filename_Nov-17-05-1055PM.xls

Any help is appreciated.
Thanks
J
 
A starting point:
strFileName = "filename_" & Format(Now, "mmm-dd-yy-hhnnAM/PM") & ".xls"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top