Asked by duncanb7
at 2024-08-27 03:54:37
Point:500 Replies:5 POST_ID:828526USER_ID:11059
Topic:
Visual Basic Programming;Microsoft Office Suite;Microsoft Excel Spreadsheet Software
I have 55000 data and need to be plotted in one curve within one plot.
But in excel, it report out just show or allow the limit 32000 data in my chart I created.
Now Can I solve it in Excel 2003 by VBA ?
I try this following VBA code before, but it is not working, just show me two sepearte curves only, how to combine two into one curve with
correct X-axis value ? OR I also need to seperate the x -axis data into two series and combine it one
by vba code ?
Please advise
Duncan
Sub Chart()
'Plot Y-axis data from two separate series into one
Dim firstrow as long
Dim lastrow as long
Dim seclastrow as long
firstrow=1
lastrow=20000
seclastrow=55000
ActiveSheet.ChartObjects("Chart 4").Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection.NewSeries 'need to be delete if create is done
ActiveChart.SeriesCollection(1).Values = "=" & sheetname & "!R" & firstrow & "C8:R" & lastrow & "C8"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).Values = "=" & sheetname & "!R" & lastrow+1 & "C8:R" & seclastrow & "C8"
End Sub
But in excel, it report out just show or allow the limit 32000 data in my chart I created.
Now Can I solve it in Excel 2003 by VBA ?
I try this following VBA code before, but it is not working, just show me two sepearte curves only, how to combine two into one curve with
correct X-axis value ? OR I also need to seperate the x -axis data into two series and combine it one
by vba code ?
Please advise
Duncan
Sub Chart()
'Plot Y-axis data from two separate series into one
Dim firstrow as long
Dim lastrow as long
Dim seclastrow as long
firstrow=1
lastrow=20000
seclastrow=55000
ActiveSheet.ChartObjects("Chart 4").Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection.NewSeries 'need to be delete if create is done
ActiveChart.SeriesCollection(1).Values = "=" & sheetname & "!R" & firstrow & "C8:R" & lastrow & "C8"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).Values = "=" & sheetname & "!R" & lastrow+1 & "C8:R" & seclastrow & "C8"
End Sub