Date of Last Update Automatically?

  • Thread starter Thread starter Crush
  • Start date Start date
C

Crush

Is there any way to have a field that will automatically
display the date of the last update?

We have a calendar online that people are questioning how
often it has been updating, so this would solve any
issues right from the start.

Thanks
 
Hi Crush

If you mean last saved date of the file??

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Sheets("Sheet1").Range("a1").Value = Date
End Sub

Right click on the Excel icon next to File in the menubar
Choose view code
Paste this event there
Alt-q to go back to Excel

If you save the file the date will be placed in A1
 
You need VBA, but you could use a UDF. Here is an example

Function DocProps(prop As String)

On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties(prop)
Exit Function

err_value:
DocProps = CVErr(xlErrValue)
End Function

Put the function in a standard code module.

and can be used like so

=DocProps("Last save time")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Hi

ActiveWorkbook.BuiltinDocumentProperties
Is not working correct in Excel 97

Read this from Tom Ogilvy

Note that this property is not maintained in xl97. However, if the workbook
is created/used in both xl97 and later versions, then when used in the
later versions and saved the property is maintained but when used in xl97
and saved, the property is not altered. The time it was last saved in the
later version will be retrieved if this property is called. If created and
used exclusively in xl97, calling this property will raise an error. You
can use the beforesave event to update this property in xl97 as a
workaround. Just test the version of excel and if xl97, update the
property.
 
Cool. Look forward to testing it out tomorrow.
Thanks much.

-----Original Message-----
Hi Crush

If you mean last saved date of the file??

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Sheets("Sheet1").Range("a1").Value = Date
End Sub

Right click on the Excel icon next to File in the menubar
Choose view code
Paste this event there
Alt-q to go back to Excel

If you save the file the date will be placed in A1



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)




"Crush" <[email protected]> wrote in
message news:[email protected]...
 
Back
Top