ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   series objects; finding specific ones in the collection (https://www.excelbanter.com/charts-charting-excel/260603-series-objects%3B-finding-specific-ones-collection.html)

cate

series objects; finding specific ones in the collection
 
When ever I wish to create a new series, no big deal:

Dim SeriesRandTarget As Series
Set SeriesRandTarget = myChart.SeriesCollection.NewSeries

As long as I have the object, I can use it. If I set the name
attribute as in
SeriesRandTarget .Name = "Hello"
I can collect it later if needed by:
Set myseries = myChart.SeriesCollection("Hello")

But what about this? What is the new series name I just created in
the below example? (The macro recorder has me in this fix!)

myChart.SeriesCollection.Paste Rowcol:=xlColumns,
SeriesLabels:=False, _
CategoryLabels:=True, Replace:=False, NewSeries:=True

The next recorded step is

myChart.SeriesCollection(4).Select

I tried slipping in Name:="My Name", but it croaks. How do you find
this series?

thank you

Andy Pope

series objects; finding specific ones in the collection
 
Hi,

Maybe you can use the counter of the collection.


set myseries = myChart.SeriesCollection(myChart.SeriesCollection. count)

Cheers
Andy

On 03/04/2010 16:17, cate wrote:
When ever I wish to create a new series, no big deal:

Dim SeriesRandTarget As Series
Set SeriesRandTarget = myChart.SeriesCollection.NewSeries

As long as I have the object, I can use it. If I set the name
attribute as in
SeriesRandTarget .Name = "Hello"
I can collect it later if needed by:
Set myseries = myChart.SeriesCollection("Hello")

But what about this? What is the new series name I just created in
the below example? (The macro recorder has me in this fix!)

myChart.SeriesCollection.Paste Rowcol:=xlColumns,
SeriesLabels:=False, _
CategoryLabels:=True, Replace:=False, NewSeries:=True

The next recorded step is

myChart.SeriesCollection(4).Select

I tried slipping in Name:="My Name", but it croaks. How do you find
this series?

thank you


--

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

cate

series objects; finding specific ones in the collection
 
On Apr 4, 6:53*am, Andy Pope wrote:
Hi,

Maybe you can use the counter of the collection.

set myseries = myChart.SeriesCollection(myChart.SeriesCollection. count)


I'll try it. I assume these are incrementing. Thanks.


All times are GMT +1. The time now is 11:57 AM.

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