+ Reply to Thread
Results 1 to 4 of 4

Date in Header

  1. #1
    Registered User
    Join Date
    02-09-2006
    Posts
    51

    Date in Header

    How can I manipulate the date in the header for a date 5 days from now, or five days from anytime a sheet is printed. (With a Macro)

  2. #2
    Registered User
    Join Date
    02-22-2006
    Location
    Ottawa, Ontario
    Posts
    4
    =now()+5
    this usually well.

  3. #3
    Dave Peterson
    Guest

    Re: Date in Header

    You'll have to use some VBA to to this.

    Option Explicit
    Private Sub Workbook_BeforePrint(Cancel As Boolean)
    With Me.Worksheets("Sheet1").PageSetup
    .LeftHeader = Format(Date+5, "mm/dd/yyyy")
    End With
    End Sub

    If you want to try...

    rightclick on the excel icon to the left of the File|Edit|View toolbar.
    Select view code and paste that subroutine into the code window.

    Change the sheet name that you need (and .leftheader to what you need) and back
    to excel to do File|Print preview.

    If you're new to macros, you may want to read David McRitchie's intro at:
    http://www.mvps.org/dmcritchie/excel/getstarted.htm

    If you want to read more about these kinds of events:

    Chip Pearson's site:
    http://www.cpearson.com/excel/events.htm

    David McRitchie's site:
    http://www.mvps.org/dmcritchie/excel/event.htm

    PBANKS wrote:
    >
    > How can I manipulate the date in the header for a date 5 days from now,
    > or five days from anytime a sheet is printed. (With a Macro)
    >
    > --
    > PBANKS
    > ------------------------------------------------------------------------
    > PBANKS's Profile: http://www.excelforum.com/member.php...o&userid=31370
    > View this thread: http://www.excelforum.com/showthread...hreadid=515761


    --

    Dave Peterson

  4. #4
    Registered User
    Join Date
    02-09-2006
    Posts
    51
    Thanks to both of you, I found a solution using input from each of you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1