Update Date, Time Only Upon Save

P

Paul Calcagno

Is there anyway to set up cells that use the Today () and/or Now ()
functions so that they only update when I re-save the file.

Right now without doing anything but opening, the day and/or time always
changes to the current date and time. I don't want that to happen.

Thanks...........Paul C.
 
M

Mike H

Hi,

No you can't do it with the NOW() formula but you can use the before save
workbook event. Alt +F11 to open Vb editor. Double click 'ThisWorkbook' and
paste the code beloew in on the right. Change the sheet and cell to suit

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


Mike
 

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