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")
 
Back
Top