Possible to assign an array to a SeriesCollection

  • Thread starter Thread starter Stephen Boulet
  • Start date Start date
S

Stephen Boulet

Can I create an array and assign it to a SeriesCollection of a chart
without that array coming from a range of cells, but as the result of
array operations?

Stephen
 
Stephen -

In VBA:

ActiveChart.SeriesCollection(1).Values = Array(3,2,1)

or

Sub AssignArray()
Dim i As Integer
Dim myVals(1 To 5) As Double
For i = 1 To 5
myVals(i) = 7 - i
Next
ActiveChart.SeriesCollection(1).Values = myVals
End Sub


- Jon
 
Back
Top