Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

https://stackoverflow.com/questions/5904967/excel-vba-to-print-the-date-and-page-number-in-the-header-and-footer/57017146#57017146

With Application
    With .ActiveSheet
    With .PageSetup
        .RightHeader = Format(Now(), "dddd, mmmm dd, yyyy")	' Saturday, July 13, 2019
        .RightFooter = "Page &P of &N"				' Page 1 of 2
End With

Date Formats → https://powerspreadsheets.com/vba-format-date/#Format-Date-Using-VBA-Display-Several-Items-Of-The-Date 

&Foo Examples → https://docs.microsoft.com/en-us/office/vba/excel/concepts/workbooks-and-worksheets/formatting-and-vba-codes-for-headers-and-footers

  • No labels