Displaying Last Saved Date in a Cell

N

Norman Harker

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.
 

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