Automatically entering the date saved in a cell

  • Thread starter Thread starter Bret B
  • Start date Start date
B

Bret B

We have used the =NOW function, but it updates each time
the file is opened. Is there a function like =SAVEDATE
that will freeze the date saved in the file so it remains
frozen until the file is saved again? THANKS!
 
Bret,

You can use ctrl+; (semi-colon) that will insert todays date. It will not
change upon opening the file again unless you change it. There is no
savedate function that I am aware of.

Wayne B
 
Bret,

Use VB. right click on the xl icon at the left most portion of your menu
bar and choose view code then the following

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Sheets("Sheet1").Range("A1").Value = Now()
End Sub

This will enter the current time to cell "A1" on sheet with name "Sheet1"
every time you save.

Regards,

Jon-jon
 
One caveat:

Since the BeforeSave event is fired before the save, the code will
be executed even if the user cancels the save.
 
I agree. Thanks!

J.E. McGimpsey said:
One caveat:

Since the BeforeSave event is fired before the save, the code will
be executed even if the user cancels the save.
 
Back
Top