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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating File Name on Save 1

Status
Not open for further replies.

markfsi

Technical User
Nov 15, 2004
3
GB
I have created a Macro which will generate a CSV export of data in my XLS Spreadsheet. However I am having trouble generating a file name. At the moment when I edit the Macro I can see the file name, what I would like to do is change the file name to be the current date in the format yyyymmddhhmm.csv

Does anyone have any ideas please?
 
Hi, markfsi

Try this:
activeworkbook.saveas "C:\Test\FileName_" & Format(Now, "yyyymmddhhmm") & ".csv", xlCSV

[tt]_____
[blue]-John[/blue][/tt]

Help us help you. Please read FAQ181-2886 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top