Automatically entering the date saved in a cell

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!
 
S

StarTrek an beyond

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
 
J

JON-JON

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
 
J

J.E. McGimpsey

One caveat:

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

JON-JON

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.
 

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

Top