Date Formats in Headers/Footers

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can the format of the current date be changed in an Excel Header or Footer when printing a document from Excel?
 
Hi

You can use the format function
Copy this event in the Thisworkbook module

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim sht As Worksheet
For Each sht In ActiveWorkbook.Sheets
sht.PageSetup.LeftFooter = Format(Now, "dd-mm-yy")
Next sht
End Sub
 
Use the beforeprint event to redefine the header . format the date as part
of a string that you build that will appear as you want. Then assign it to
the appropriate property of PageSetup.

--
Regards,
Tom Ogilvy


Twoo Doggs said:
How can the format of the current date be changed in an Excel Header or
Footer when printing a document from Excel?
 
Back
Top