View Single Post
  #1   Report Post  
 
Posts: n/a
Default Setting Series data in VBA

I have the following snippet of code where I am trying to update a
series in my chart:

************************************************** **
ActiveSheet.ChartObjects("Chart 6").Activate
ActiveChart.ChartArea.Select
ActiveChart.SeriesCollection(1).Values = MySeriesString
************************************************** **

In a large amount of previous code I have set MySeriesString to the
following in order to pick the exact cells I want in the plot:

"Results!D6,Results!D10,Results!D14,Results!D18,Re sults!D22,Results!D26,Results!D30"

But when I get to the line where I set the series values to
MySeriesString I get an error:

"Unable to set the Values property of the Series class"

I assume I just don't understand how to format the MySeriesString. I
have tried many combinations of putting an "=" sign and brackets around
the data, but I can't seem to figure it out. Can anyone help me with
that?

Thanks,
Matt