ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to have:= NOW () date/time change only if updated and saved (https://www.excelbanter.com/excel-worksheet-functions/39146-how-have-%3D-now-date-time-change-only-if-updated-saved.html)

Bob Provis

How to have:= NOW () date/time change only if updated and saved
 
How may I set a shared excel file to only update a present time and date
field when the sheet has actually been modified and saved?
OS = MS 2000 pro
Excel = 2000

Ron de Bruin

Hi Bob

See
http://www.rondebruin.nl/print.htm#Saved

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Bob Provis" <Bob wrote in message ...
How may I set a shared excel file to only update a present time and date
field when the sheet has actually been modified and saved?
OS = MS 2000 pro
Excel = 2000




Bob Phillips

You need VBA to write it when saved

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Range("A1").Value = Format(Now, "dd mmm yyyy hh:mm:ss")
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Bob Provis" <Bob wrote in message
...
How may I set a shared excel file to only update a present time and date
field when the sheet has actually been modified and saved?
OS = MS 2000 pro
Excel = 2000





All times are GMT +1. The time now is 01:30 AM.

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