ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Array as chart series data source (https://www.excelbanter.com/excel-programming/327760-array-chart-series-data-source.html)

Mitch

Array as chart series data source
 
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.

Peter T

Array as chart series data source
 
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

"Mitch" wrote in message
...
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.





All times are GMT +1. The time now is 09:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com