Date in Header/Footer

  • Thread starter Thread starter Nick
  • Start date Start date
N

Nick

Does anyone know how to put the latest "revision date" in
the header or footer. All I can get is the date printed
or any text I may put in. I would like it to
automatically update the header/footer with the date any
changes are made.

Please help,

Nick
 
Hi Nick,

Private Sub Workbook_BeforePrint(Cacel As Boolean)
With ActiveWorkbook
.ActiveSheet.PageSetup.LeftHeader = "Last saved on: " & _
Format(.BuiltinDocumentProperties("Last Save Time"), "dd mmm
yyyy")
End With
End Sub

goes in the ThisWorkbook code module

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Hi
you need VBA for this. Put the following code in your
workbook module (not in a standard module):
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ActiveWindow.Worksheets
With wkSht.PageSetup
.LeftHeader = Me.BuiltinDocumentProperties _
("last save time")
End With
Next wkSht
End Sub
 

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

Back
Top