ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Update Date, Time Only Upon Save (https://www.excelbanter.com/excel-discussion-misc-queries/228732-update-date-time-only-upon-save.html)

Paul Calcagno

Update Date, Time Only Upon Save
 
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.


Mike H

Update Date, Time Only Upon Save
 
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

"Paul Calcagno" wrote:

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.




All times are GMT +1. The time now is 07:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com