unable to set values property of series class

shantanu

New Member
Joined
Jul 30, 2010
Messages
22
I am looping through data to plot trends. I plot the first trend but I get an error at the 2nd. It says: Error 1004 unable to set values property of series class.
What could be the issue?
Please help.

Code:
For i = 0 To 6
Set y02error(i) = SheetY02.Range(Cells(33 + 35 * i, 4 + 14 * j), Cells(42 + 35 * i, 4))
Set y02setp(i) = SheetY02.Range(Cells(33 + 35 * i, 8), Cells(42 + 35 * i, 8))
Next i
'add chart'
Charts.Add
If SheetY02.Name = "Y02A" Then
ActiveChart.Name = m(j) & "-A"
ElseIf SheetY02.Name = "Y02B" Then
ActiveChart.Name = m(j) & "-A"
End If
ActiveChart.ChartType = xlXYScatterLines
'specifying the series for charting'
For i = 0 To 6
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(i + 1).XValues = y02setp(i)
ActiveChart.SeriesCollection(i + 1).Values = y02error(i)
ActiveChart.SeriesCollection(i + 1).Name = SheetY02.Cells(10 + 35 * i, 1)
Next i
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,927
Messages
5,834,404
Members
430,282
Latest member
MeredithD26

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top