Save As macro with date/time stamp

  • Thread starter Thread starter Jim A
  • Start date Start date
J

Jim A

Hi -
I have been trying to get a date and time stamp within my code. I have this:

ActiveWorkbook.SaveAs Filename:=Sheets("1").Range("B1").Value & " " &
Sheets("1").Range("AS1")

with range("AS1") being a worksheet function of =TEXT(NOW(),"dd-mmm-yy")
which does not allow for Time.

Can anybody help me get the date and time stamp in the code itself?

Thanks - Jim A
 
One way:

ActiveWorkbook.SaveAs Filename:=Sheets("1").Range("B1").Value & _
Format(Now, " dd-mm-yy hh:mm:ss")
 

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

Similar Threads

macros 0
Time/Date Stamp 3
Date Stamp with protection 6
separating date and time 5
date stamp 2
Macro does not finish 17
Dates in a macro 4
Dynamic Offset from an Application.Goto cell = Date or Time 10

Back
Top