View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.charting
Andy Pope Andy Pope is offline
external usenet poster
 
Posts: 2,489
Default How to return the address of the range of plotted data on anXY scatter chart?

No need to activate, just need the Chart part of the OM.

?sheet1.ChartObjects("Chart 1").chart.SeriesCollection(1).formula

Cheers
Andy

Ken Johnson wrote:
Hi Andy,

When I type this in the Immediate Window...

sheet1.ChartObjects("Chart 1").activate
?activechart.SeriesCollection(1).formula

the returned value is..

=SERIES(Sheet1!$B$1,Sheet1!$A$2:$A$11,Sheet1!$B$2: $B$11,1)

which is fine.

I thought I could skip the activate step so I tried...

?sheet1.ChartObjects("Chart 1").SeriesCollection(1).formula

which did not work.

Is it therefore true to say that with embedded charts the code must
activate the chart before the SeriesCollection can be accessed, or am I
doing something wrong?

Ken Johnson


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info