Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Durham, North Carolina, USA
    Posts
    140
    Thanks
    5
    Thanked 1 Time in 1 Post

    Formatting the date in a header (Excel XP)

    Howdy,

    Is there a quick easy way to format the date in a header or footer in Excel? All dates for this workbook are supposed to be "dd-mmm-yyyy".

    I suppose I could change the default date format for Windows, but that seems overkill.

    Thanks,

    Beej

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Formatting the date in a header (Excel XP)

    The header uses the default window format.

    You could use a macro on the BeforePrint event (this will add to center footer (change as desired)

    <pre>Option Explicit
    Private Sub Workbook_BeforePrint(Cancel As Boolean)
    Dim sht
    For Each sht In ActiveWindow.SelectedSheets
    sht.PageSetup.CenterFooter = Format(date, "dd-mmm-yyyy")
    Next
    End Sub</pre>


    Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •