=NOW()

G

Guest

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.
 
G

Guest

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.
 

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