How can you save a spreadsheet with a date stamp.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to save a file 2 times the first time for production, the second time
as a backup, I want the backup file to have a date stamp (ex.
gltransfer051506.csv).
i need the date to update each day it run.???
 
This macro may do what you wish, it also adds the TIME......

Sub AddDateToFilename()
Dim Dname As String
Dname = ThisWorkbook.FullName
Dname = Left(Dname, Len(Dname) - 4) & _
Format(Now, "yyyymmdd_hh_mm_ss") & ".xls"
ThisWorkbook.SaveCopyAs Dname
End Sub

Vaya con Dios,
Chuck, CABGx3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top