Simple...Update Text Box in Chart

I

Intui_Sol

Hello,

I have a chart in an MS Excel worksheet and I would like to change the
value/caption of a textbox( Text Box 20).

I have only been able to change the title of the chart with the
following:

With MyChart.Workbooks(1).Worksheets("Chart").ChartObjects(1).Chart
.HasTitle = True
.ChartTitle.Text = "Summary of Report" & date() 'Add
Today's Date
End With

Do I have to reference the chart or do I have to reference the textbox
itself?
 
A

Andy Pope

Hi,

If the shape is actual embedded in the chart object then something like,

ActiveChart.Shapes("Text Box 20").TextFrame.Characters.Text = _
"Hello World"

If the shape is just over the chart then replace ActiveChart with
Activesheet

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