ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Getting series name (https://www.excelbanter.com/excel-programming/332727-getting-series-name.html)

dan2

Getting series name
 

I am trying to get information about charts from an automation object, I
have managed to get the chart names using:

Excel.ActiveSheet.ChartObjects(i).Name

But now I want to get the series names, according to the information I
have found so far this should work, but it doesn't:

Excel.ActiveSheet.ChartObjects(i).Chart.SeriesColl ection(n).Name

(Where i is looping through the charts and n is looping through the
SeriesCollections)

What am I doing wrong? Is it even possible to get the series name?

TIA!


--
dan2
------------------------------------------------------------------------
dan2's Profile: http://www.excelforum.com/member.php...o&userid=24601
View this thread: http://www.excelforum.com/showthread...hreadid=381893


mangesh_yadav[_359_]

Getting series name
 

This works nicely for me.

Private Sub CommandButton1_Click()
For i = 1 To ActiveSheet.ChartObjects.Count
MsgBox ActiveSheet.ChartObjects(i).Name
For Each sr In
ActiveSheet.ChartObjects(i).Chart.SeriesCollection
MsgBox sr.Name
Next
Next i
End Sub


Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=381893


Tushar Mehta

Getting series name
 
How does it not work? Do all your series have a name?

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...

I am trying to get information about charts from an automation object, I
have managed to get the chart names using:

Excel.ActiveSheet.ChartObjects(i).Name

But now I want to get the series names, according to the information I
have found so far this should work, but it doesn't:

Excel.ActiveSheet.ChartObjects(i).Chart.SeriesColl ection(n).Name

(Where i is looping through the charts and n is looping through the
SeriesCollections)

What am I doing wrong? Is it even possible to get the series name?

TIA!


--
dan2
------------------------------------------------------------------------
dan2's Profile:
http://www.excelforum.com/member.php...o&userid=24601
View this thread: http://www.excelforum.com/showthread...hreadid=381893




All times are GMT +1. The time now is 10:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com