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

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,214,918
Messages
6,122,255
Members
449,075
Latest member
staticfluids

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
Back
Top