Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Youngstown, Ohio, USA
    Posts
    705
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Dynamic graph titles (Excel 2000 SR-1)

    I need to set up a number of graphs that will be printed monthly, reporting year-to-date information. I would like to have the graphs set up to have "YTD Report through [ThroughDate]" included in each graph's title, but I can't find any way to do this through formulas, so now I'm thinking about using a VBA-based solution. How would I go about appending a text-formatted 'date' to a text string and setting this new string as the page header for these graphs?

    I recorded a macro (extract below) that would set the base header, but I'm a little stumped on the rest of it.
    <pre> With ActiveChart.PageSetup
    .LeftHeader = ""
    .CenterHeader = "&""Times New Roman,Bold""&16YTD Report through "
    .RightHeader = ""
    .LeftFooter = ""
    .CenterFooter = ""
    .RightFooter = ""
    End With</pre>


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

    Re: Dynamic graph titles (Excel 2000 SR-1)

    David,

    There may no need for a macro. Compose the header you require in a normal cell, out the way somewhere. Craete your chart and include a dummy title.

    When your chart is in place select the title, and in the formula bar point to the cell with the formula. The results of your fomula should now be in the Chart Title. You can apply independent formatting as required.

    Andrew C

Posting Permissions

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