Hi Alex,
We can add a chart into the workbook and set its series based on array.
Here is the code you may run on the VBA environment of Excel to see if that
is what you want.
Sub Test()
Charts.Add
ActiveChart.ChartType = xlXYScatterLines
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = Array(1, 3, 5, 7, 11, 13, 17,
19)
ActiveChart.SeriesCollection(1).Values = Array(1, 3, 5, 7, 11, 13, 17,
19)
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).XValues = Array(11, 13, 17, 19, 1, 3,
5, 7)
ActiveChart.SeriesCollection(2).Values = Array(1, 3, 5, 7, 11, 13, 17,
19)
End Sub
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.