I have asked this in another forum without any replies - I am hoping for success here please.
I have greater than 130,000 data points I want to plot on a scatter plot in Excel 2007 using vba.
The data points are in a worksheet "Data" in columns 2 and 6 and I have produced subsets of 32000 values in columns 15,16 and 17,18 and 19,20 etc
All data in columns 2,15,17 are sorted in increasing values.
The code I use to plot these points in chart "cname" is:
When I step through this code, I can see the first subset of data plots ok then when I get to the second subset, it plots ok but as soon as it plots, the first data set disappears. Similarly with subsequent data sets, only the last plotted data set remains.
Can any one tell me what is happening? Are sequential data sets being plotted as different series and then becoming invisible?
If I try and create the plot manually, I can add the data sets ok but they are added as separate series but that is ok, I can change the format of the points and they all look like they are part of the one series.
So how do I do this in VBA?
Thanks
I have greater than 130,000 data points I want to plot on a scatter plot in Excel 2007 using vba.
The data points are in a worksheet "Data" in columns 2 and 6 and I have produced subsets of 32000 values in columns 15,16 and 17,18 and 19,20 etc
All data in columns 2,15,17 are sorted in increasing values.
The code I use to plot these points in chart "cname" is:
Code:
[COLOR=#333333]Sheets("Data").Select[/COLOR]
<code style="margin: 0px; padding: 0px; font-style: inherit;"> Set data_range1 = Range(Cells(2, 2), Cells(32001, 2))
Set data_range2 = Range(Cells(2, 6), Cells(32001, 6))
Sheets(cname).Select
ActiveChart.SeriesCollection(1).XValues = data_range1
ActiveChart.SeriesCollection(1).Values = data_range2
If n_subsets > 0 Then
kk = 0
For ll = 1 To n_subsets
Sheets("Data").Select
Set data_range1 = Range(Cells(2, 15 + kk), Cells(32001, 15 + kk))
Set data_range2 = Range(Cells(2, 16 + kk), Cells(32001, 16 + kk))
Sheets(cname).Select
ActiveChart.SeriesCollection(1).XValues = data_range1
ActiveChart.SeriesCollection(1).Values = data_range2
kk = kk + 2
Next ll </code>[COLOR=#333333]
End If
[/COLOR]
When I step through this code, I can see the first subset of data plots ok then when I get to the second subset, it plots ok but as soon as it plots, the first data set disappears. Similarly with subsequent data sets, only the last plotted data set remains.
Can any one tell me what is happening? Are sequential data sets being plotted as different series and then becoming invisible?
If I try and create the plot manually, I can add the data sets ok but they are added as separate series but that is ok, I can change the format of the points and they all look like they are part of the one series.
So how do I do this in VBA?
Thanks