
3,971 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Sub chartj()
Dim points, n, i
n = 1000
Dim xtab As Variant
Dim ytab As Variant
ReDim xtab(1 To n)
ReDim ytab(1 To n)
For i = 1 To n
xtab(i) = i
ytab(i) = i
Next i
Charts.Add
ActiveChart.ChartType = xlXYScatter
ActiveChart.SetSourceData Source:=Sheets("Sheet2").Range("F9")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = xtab
ActiveChart.SeriesCollection(1).Values = ytab
points = ActiveChart.SeriesCollection(1).points.Count
' only charts 256 data points, not 1000 as expected
End Sub