Displaying Last Saved Date in a Cell

  • Thread starter Thread starter Adam
  • Start date Start date
Hi Adam!

You can use a before saving event handler:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Sheets("Sheet1").Range("A1").Value = Now
End Sub

The date and time will be entered into Sheet1, A1 each time the file
is saved. Format A1 to taste.

But if you want the saved time for a newly opened workbook then as
long as the document was created in Excel 2000 and above you'll need a
UDF that you can put in your Personal.xls file

Function DocSaveTime(property)
On Error GoTo Stuffup_err
DocSaveTime = ActiveWorkbook.BuiltinDocumentProperties(prop)
Exit Function
Stuffup_err:
DocSaveTime = CVErr(xlErrValue)
End Function

This can be used on your workbook with

=DocSaveTime("Last Save Time")

Format the cell to taste.

If the workbook has never been opened in a +Excel 97 Version, you'll
get an error. If it has, you will get the last time it was saved
in a version that maintains the property
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
Back
Top