Array as chart series data source

G

Guest

Is it possible to use array variable values as the source for a chart series?
I have tried to use the SetSourceData method which failed because the method
was looking for a range.
 
P

Peter T

Sub test()
Dim sr As Series
Dim vY, vX

vY = Array(1, 2, 3)
vX = Array("AA", "BB", "CC")

Set sr = ActiveChart.SeriesCollection.NewSeries
sr.Values = vY
sr.XValues = vX

End Sub

Also look at series.Formula

Regards,
Peter T
 

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