Chart Object Caption
Greg, thanks for this. The code added a title inside the chart as a title
(which is an *Excellent* innovation. The blue banner itself however still
says "Sheet 1.xls Chart 109". Can you help with the banner name change?
I really appreciate you taking the time to help.
sincerely
Jeff Smith
"Greg Wilson" wrote in message
...
Try the following two options. The first doesn't require
that the chart be selected and assumes that it is a
worksheet based (embedded) chart. It is also assumed that
it is the first chart added to the worksheet (if more than
one). Change the ChartObject index number (in
parenthesis) to suit if necessary.
Also note that the line ".HasTitle = True" is only
necessary if no title already exists. Change to False to
suppress the chart title.
Preferred code:
Sub ChangeChartTitle()
With ActiveSheet.ChartObjects(1).Chart
.HasTitle = True
.ChartTitle.Characters.Text = "Annual Widget Sales"
End With
End Sub
Alternate code:
Sub ChangeChartTitle()
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Annual Widget Sales"
End With
End Sub
Hope it does the job.
Regards,
Greg
-----Original Message-----
I have a control that brings up a graph. The Excel name
for the graph shown
in the caption is "Sheet 1 Chart 109".
My question is how can I give the chart a new caption?
and /or
How can I suppress the caption (for other chart objects
in the workbook)
I have tried ActiveChart.Caption = "NewTitle" but VBA
wouldn't accept this.
Would someone be kind enough to help resolve this.
(I'm very impressed with this News Group - I am learning
new techniques,
almost daily)
TIA
regards
Jeff Smith
.
|