Multiple fonts in a chart title

rdw72777

Well-known Member
Joined
Apr 5, 2005
Messages
723
It looks like this might be impossible, but I was just curious if anyone had solved this.

Basically I have a 3 line chart title where the first line is Bold anf 18 point font, the second line is 14 point and itallic and bold and the third line is 12 point and italic.

I set the chart title through code below:

Code:
Sheets(myRegion).ChartTitle.Text = _
     "East Region" & Chr(13) & "PTS Actual/Projected FTE Utilisation by Project" & _
          Chr(13) & "(for the 18 months ended September 30, 2012)" & Chr(13) & ""

So I'd like "East Region" to be 18 point font, "PTS Actual/Projected FTE Utilisation by Project" to be 14 point and bold and "(for the 18 months ended September 30, 2012)" to be 12 point and itallic.

Has anyone solved this using the ChartTitle? I'm sure it could be done by inserting 3 text boxes but that isn't an option I'm allowed in this particular exercise....
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Try:

Code:
    With Sheets(myRegion).ChartTitle
        .Text = _
            "East Region" & Chr(13) & "PTS Actual/Projected FTE Utilisation by Project" & _
            Chr(13) & "(for the 18 months ended September 30, 2012)" & Chr(13) & ""
        With .Characters(Start:=1, Length:=Len("East Region")).Font
            .FontStyle = "Bold"
            .Size = 18
        End With
        With .Characters(Start:=Len("East Region") + 2, Length:=Len("PTS Actual/Projected FTE Utilisation by Project")).Font
            .FontStyle = "Bold"
            .Size = 14
        End With
        With .Characters(Start:=Len("East Region" & Chr(13) & "PTS Actual/Projected FTE Utilisation by Project") + 2, Length:=Len("(for the 18 months ended September 30, 2012)")).Font
            .FontStyle = "Italic"
            .Size = 12
        End With
    End With
 
Upvote 0
Curious about maybe a different workaround since I only have Excel 2007.

I use a macro tos et the chart tile to begin with, using a template for the chart. the chart template has the correct formatting beofre I set the chart title in my code. For instance, before it says "East Region" it simply says "My Region".

Is there a way to do find->replace with a chart title? If so, maybe doing so wouldn't tweak the chart title formatting the same way setting the charttitle.text method does.
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,147
Members
452,891
Latest member
JUSTOUTOFMYREACH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top