Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Not in KC anymore
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Header with dates automatically populated (97)

    OK

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Header with dates automatically populated (97)

    [Edited. Twice! The original was quick, dirty, and wrong, the second version close but no cigar! That'll teach me to test more carefully.]

    You may need to format as required:

    With ActiveSheet.PageSetup
    .CenterHeader = "Activity for " & Date + 1 & " through " & Date + IIf(Date Mod 7 > 2, 7, 5)
    <other page setup commands if any>
    End With

    What different dates do you use on Friday? If you skip to next Monday, try:

    .CenterHeader = "Activity for " & Date + 1 - CInt(Date Mod 7 = 6) * 2 & _
    " through " & Date + IIf(Date Mod 7 > 2, 7, 5)

    (The counterintuitive minus is because CInt(Date Mod 7 = 6) returns -1 if true)
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Not in KC anymore
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Header with dates automatically populated (97)

    Looks like the third time's the charm.

    Thanks a bunch.

Posting Permissions

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