How do I display the last updated date in the page header?

  • Thread starter Thread starter Aging Hippie
  • Start date Start date
A

Aging Hippie

I need to display the date the workbook was last modified in the page header
when it's printed.
 
Hi,

Alt + F11 to open VB editor. Double click 'This workbook' and paste this in
on the right. Change the range to suit.

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

Mike
 
There is no "modified" property

Best you can get is last saved time.

Sub printit()
ActiveSheet.PageSetup.RightHeader = "&8Last Saved : " & _
Format(ThisWorkbook.BuiltinDocumentProperties("Last Save Time"), _
"yyyy-mmm-dd hh:mm:ss")
End Sub


Gord Dibben MS Excel MVP
 
Back
Top