I have written vba code for naming the series in a graph:
ActiveChart.SeriesCollection(1).name = "SPEC"
ActiveChart.SeriesCollection(2).name = "manju"
My problem is that I want to find the particular series name using vba code.
In the above code I have two series.
Now I want find the series name (manju) by using vba code.
To access the
SeriesCollection()by passing the name you can:That’s possible because
indexin theSeriesCollection(index)is actually ofVarianttype so the compiler works out if you are passing aStringtype and trying to access it by name or if you are passing aLong/Integer(or any other numeric data type) to access the enumerator.or iterate the SeriesCollection, comparing the current name against “manju”: