ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using Arrays as source data for charts (https://www.excelbanter.com/excel-programming/357341-using-arrays-source-data-charts.html)

MJH2369

Using Arrays as source data for charts
 
Is it possible to use arrays (up to 10,000 elements) as source data for charts?
I have been able to get arrays with 28 elements to work with:

i = 0
Do Until i = UBound(DataArray, 1) + 1
ReDim Preserve xArray(i) As Double
ReDim Preserve yArray(i) As Double
xArray(i) = DataArray(i, 0)
yArray(i) = DataArray(i, 1)
i = i + 1
Loop

Charts.Add

ActiveChart.ChartType = xlXYScatterLinesNoMarkers
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = xArray()
ActiveChart.SeriesCollection(1).Values = yArray()


I am importing data from a text file and i'd rather not put the data in a
spreadsheet.

Thanks,

Matt


All times are GMT +1. The time now is 01:29 PM.

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