Possible to assign an array to a SeriesCollection

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
 
J

Jon Peltier

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top