Excel Chart Title

N

nzadmin

I'm using excel 2007 Service Pack 2.

Trying to change part of the chart title. No problem in previous versions of
Exel.
Now the whole Title changes - not just part of it. Following is sample code:


Sub test()

Workbooks("Book1.xlsx").Activate
Charts("Chart1").Select

Title1 = "New Title1"
Title2 = "New Title2"
Title = Title1 & Chr(10) & Title2
ActiveChart.ChartTitle.Text = Title

ActiveChart.ChartTitle.Select

With ActiveChart.ChartTitle
With .Characters(Start:=1, Length:=Len(Title1)).Font
.Name = "Arial"
.FontStyle = "Normal"
.Size = 20
End With

With .Characters(Start:=Len(Title1) + 1, Length:=Len(Title2)).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 12
End With
End With

End Sub
 
A

Andy Pope

Hi,

This is a known bug in 2007.
Work around is to use a textbox.

Cheers
Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top