Displaying Date Saved

D

Dave L

Is there any way to display the last date saved of a
worksheet? In WORD if I create a header/footer and insert
a field (SaveDate) it always updates to the value of the
last date/time the file was saved.How can I do this in
Excel?
 
F

Frank Kabel

Hi Dave
if you want to insert the last save date in your header/footer insert
the following code in your workbook module
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In Me.Worksheets
With wkSht.PageSetup
.CenterFooter =
Format(ActiveWorkbook.BuiltinDocumentProperties _
("Last save time"),"DD.MM.YYYY")
End With
Next wkSht
End Sub


If you want this date in one of your cells you may use the following
user defined function:
Function DocProps(prop As String)
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties (prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function

Now you can use the following formula in one of your cells:
=DocProps("Last save time")
 
M

markstro

Dave L said:
Is there any way to display the last date saved of a
worksheet? In WORD if I create a header/footer and insert
a field (SaveDate) it always updates to the value of the
last date/time the file was saved.How can I do this in
Excel?

Yes, use the same header/function you use in Word.
Preview your spreadsheet, click setup then the header/footer tab and away
you go.
(e-mail address removed)
 

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