Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Las Vegas, Nevada, USA
    Posts
    334
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Putting Cell Contents into a Print Header, Then Formatting

    I am trying to get a cell's contents into a Print Header and then Format that header for a report. I have gotten the VBA code so far for the cell contents. Likewise, I see how to format the contents of a Print Header. But I can't get the two to work together. I've tried using the macro recorder but I haven't had any luck.

    Here's what I got so far (in no particular order. well none that work properly, anyway)

    ActiveSheet.PageSetup.CenterHeader = "&""Calibri,Bold""&18"
    ActiveSheet.PageSetup.CenterHeader = Range("p1").Value

    How do I get the cell contents formatted?

    Cell Contents of P1 =CONCATENATE("FAIR SHARE REPORT","
    ",TEXT(+'DROP & WIN DATA'!A1,"MMM-YYYY"))

  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
    Your 2nd line rewrites the header, eliminating the formatting. it needs to be one line:

    ActiveSheet.PageSetup.CenterHeader = "&""Calibri,Bold""&18" & Range("p1").Value

    Steve

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Las Vegas, Nevada, USA
    Posts
    334
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Perfect. Thanks 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
  •