• RyanDev.com

  • How to add custom information to the footer of an Excel spreadsheet

7th November 2008

How to add custom information to the footer of an Excel spreadsheet

The Page Setup window of Excel does not offer many choices for adding dynamic information into the header and footer.

Excel Page Setup

To add the time the file was last saved use the following code:

Sub LastSavedTimeInFooter()
ActiveSheet.PageSetup.CenterFooter = ActiveWorkbook.BuiltinDocumentProperties(”Last Save Time”)
End Sub

Note, the above code will have to be manually run.  To have this happen automatically you could do the following:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.CenterFooter = ActiveWorkbook.BuiltinDocumentProperties(”Last Save Time”)
End Sub

With this code it would automatically run every time you had to print and would always be updated on your hard-copies. 

This entry was posted on Friday, November 7th, 2008 at 8:32 pm and is filed under Microsoft Excel, Microsoft Office. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

  • Links

  • Calendar

  • February 2012
    S M T W T F S
    « Jan    
     1234
    567891011
    12131415161718
    19202122232425
    26272829