Access an embedded chart via its name???

DashBoarder

New Member
Joined
Sep 9, 2014
Messages
9
Greetings to all!

Excel 2010
Win7 Ultimate SP1

I'm working on some dashboards using embedded charts. I know how to access a chart by first activating it, then using ActiveChart to modify it, e.g....

ActiveSheet.ChartObjects("TestChart2").Activate
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).Name = "=Sheet2!$R$2"
...

But is there a way to access a chart directly, by name, without having to first activate it? If possible, I prefer to interact with entities by name rather than selecting or activating them first.


Thanks!
 

Some videos you may like

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,826
Hi
Welcome to the board

Try:

Code:
...
Dim cht As Chart

Set cht = ActiveSheet.ChartObjects("TestChart2").Chart
With cht
    .SeriesCollection.NewSeries
    .SeriesCollection(2).Name = "=Sheet2!$R$2"
    ' ...
End With
...
 

Watch MrExcel Video

Forum statistics

Threads
1,108,816
Messages
5,525,064
Members
409,617
Latest member
Lenaf

This Week's Hot Topics

Top