Question

I have a code that creates 2 new sheets. Then it should plot a new series collection from the new sheets. I managed to do that with ActiveSheet and etc, but the new SeriesCollection is in the wrong chart type. I want to give a working name to the new series collection uppon creation. How?

Dim ser As SeriesCollection
Set ser = ch.chart.SeriesCollection.Add'---> ERROR HERE

ser.Name = "='" & nshn & "_Table'!$H$2:$K$2"
ser.XValues = "='" & nshn & "_Table'!$B$6:$B$38"
ser.Values = "='" & nshn & "_Table'!$C$6:$C$38"
Was it helpful?

Solution

Try this :

Dim ser As Series
set ser = ch.chart.SeriesCollection.NewSeries
'...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top