Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 3,355
Default Finding series index if I know the Series Name

I have the following code to find the series index #, but it's not working.
What am I doing wrong.

Dim Series As Series
Dim SeriesNum As Integer
Dim SeriesName As String

SeriesName = "Y axis Labels"

Debug.Print CHARTNAME.SeriesCollection.Count
For Each Series In CHARTNAME.SeriesCollection
'On Error Resume Next
Debug.Print Series.Name
Debug.Print Series.Index <~~~~it doesn't like this.
If Series.Name = SeriesName Then
Debug.Print Series.Index
Exit For
End If


Next Series


Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Finding series index if I know the Series Name

Hi,

There is no index property. You would need to increment your own counter.
The order is dependent on 3 things. ChartType, Plot/Series Order and Axis.

What exactly are you trying to achieve?

Cheers
Andy

Barb Reinhardt wrote:
I have the following code to find the series index #, but it's not working.
What am I doing wrong.

Dim Series As Series
Dim SeriesNum As Integer
Dim SeriesName As String

SeriesName = "Y axis Labels"

Debug.Print CHARTNAME.SeriesCollection.Count
For Each Series In CHARTNAME.SeriesCollection
'On Error Resume Next
Debug.Print Series.Name
Debug.Print Series.Index <~~~~it doesn't like this.
If Series.Name = SeriesName Then
Debug.Print Series.Index
Exit For
End If


Next Series


Thanks!


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Finding series index if I know the Series Name

You could also try the .PlotOrder of the series.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Andy Pope" wrote in message
...
Hi,

There is no index property. You would need to increment your own counter.
The order is dependent on 3 things. ChartType, Plot/Series Order and Axis.

What exactly are you trying to achieve?

Cheers
Andy

Barb Reinhardt wrote:
I have the following code to find the series index #, but it's not
working. What am I doing wrong.

Dim Series As Series
Dim SeriesNum As Integer
Dim SeriesName As String

SeriesName = "Y axis Labels"

Debug.Print CHARTNAME.SeriesCollection.Count
For Each Series In CHARTNAME.SeriesCollection
'On Error Resume Next
Debug.Print Series.Name
Debug.Print Series.Index <~~~~it doesn't like this.
If Series.Name = SeriesName Then
Debug.Print Series.Index
Exit For
End If
Next Series


Thanks!


--

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart -- Source Data... -- Series dialog window Sarah Jane Charts and Charting in Excel 2 January 24th 06 11:27 AM
Help needed in finding specific series via row. hadmybreaktoday Excel Worksheet Functions 5 August 24th 05 06:13 PM
finding the row index for the last value > than some value z.entropic Excel Worksheet Functions 3 April 18th 05 11:32 PM
How to change Series order in a Combination Chart? vrk1 Charts and Charting in Excel 3 April 1st 05 07:21 AM
series graph -- one series being added to another series rich zielinski via OfficeKB.com Charts and Charting in Excel 3 March 30th 05 06:23 PM


All times are GMT +1. The time now is 01:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"