referencing a dynamic array

  • Thread starter Thread starter hke
  • Start date Start date
H

hke

Hi all!

I`m having trouble with referring to a dynamic seriesin my vba macro. I
created theseries inside the macro like this

With Currentchart.SeriesCollection.NewSeries
XValues = "=sheet1!myX"

Which works fine.

the problem is that later I need to assign to refer to the elements in
the series. How can I access them?

I tried to declare a dynamic array and set it equal to the series,
Public myX() As Integer
myX() = "=sheet1!myX"

but then get the message
"can`t assign to array"

:confused:
 
Hi,

I'm not entirely sure what you're trying to do here. Do you want to refer to
the new series you have created or to the actual dynamic range itself?

If I follow you, it's the former in which case you can refer to them in the
following way:

CurrentChart.SeriesCollection(x).points(y).

Where x is the index of NewSeries you created earlier.

Post back if I've got the wrong end of the stick.

Cheers, Pete
 
Back
Top