Save file with time date stamp

  • Thread starter Thread starter oberon.black
  • Start date Start date
O

oberon.black

I have this code


Code:
--------------------

ActiveWorkbook.SaveAs Filename:="c:\t\q1\blue\save\"filename""

--------------------


I want the 'filename to be todays time and date.

How do I make this happen?
 
Hi Oberon,

Try:

Dim sStr As String

sStr = Format(Now, "yyyymmdd (hh-mm)") & ".xls"
ActiveWorkbook.SaveAs Filename:="c:\t\q1\blue\save\" & sStr

Change the date / time format to suit.

---
Regards,
Norman



"oberon.black" <[email protected]>
wrote in message
news:o[email protected]...
 

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