ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   =NOW() (https://www.excelbanter.com/excel-worksheet-functions/157315-%3Dnow.html)

f16pilot71

=NOW()
 
When I insert the NOW function in my worksheet, it updates whenever I open
it. I only want the function to work when I hit "save" or update a cell in
the worksheet, so that the date/time indicate the last time someone
reviewed/changed it, not the last time it was simply opened.

MartinW

=NOW()
 
Hi,

NOW and other volatile functions don't just change when the file is
opened, they change every time the sheet is recalculated.

Take a look here for a workaround.
http://www.mcgimpsey.com/excel/timestamp.html

HTH
Martin


"f16pilot71" wrote in message
...
When I insert the NOW function in my worksheet, it updates whenever I open
it. I only want the function to work when I hit "save" or update a cell
in
the worksheet, so that the date/time indicate the last time someone
reviewed/changed it, not the last time it was simply opened.




Michael

=NOW()
 
Hit Alt F11

Click On the "ThisWorkbook" object, then click on the left dropdown box and
Select Workbook
Click on The right dropdown box and select BeforeSave
Add this:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Range("A1").Value = Now()
End Sub
This will place the result of Now() in Cell A1; change it to the cell you
want.
Note it won't execute on the first save, because is just saving the code,
but from then on it will execute only when saving the workbook.
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"f16pilot71" wrote:

When I insert the NOW function in my worksheet, it updates whenever I open
it. I only want the function to work when I hit "save" or update a cell in
the worksheet, so that the date/time indicate the last time someone
reviewed/changed it, not the last time it was simply opened.



All times are GMT +1. The time now is 12:59 PM.

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