Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Oct 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    excel header date question' (excel xp)

    I created a form in excel and I need the date in a header to change every time it prints. Basically it
    Attached Files Attached Files

  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: excel header date question' (excel xp)

    try something like:

    Private Sub Workbook_BeforePrint(Cancel As Boolean)
    ActiveSheet.PageSetup.centerHeader = _
    format (Now, "dddd, mmmm d, yyyy")
    End Sub

    Steve

  3. #3
    New Lounger
    Join Date
    Oct 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: excel header date question' (excel xp)

    thanks for replaying but i got little problem,were do i type this?

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: excel header date question' (excel xp)

    I am attaching a copy of your workbook with the following code in Thisworkbook object. The code should change the Header of all worksheets each time the workbook is printed.

    Private Sub Workbook_BeforePrint(Cancel As Boolean)
    Dim ws As Worksheet
    For Each ws In Me.Worksheets
    With ws.PageSetup
    .CenterHeader = Format(Date, "mm/dd/yy")
    .RightHeader = Format(Date, "dddd")
    End With
    Next
    End Sub

    Andrew C
    Attached Files Attached Files

  5. #5
    New Lounger
    Join Date
    Oct 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: excel header date question' (excel xp)

    thanks

Posting Permissions

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