Hello All,
I am trying to write a macro that will add a number of series to an x-y scatter. I have the code for each occurrence, but I would like a method to continue this for the next 30 rows. Does anybody have a suggestion that does not involve c and p, then replacing the numbers each time?
Cheers,
Pedro


ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).Name = "=Sheet1!$A$2"
ActiveChart.SeriesCollection(2).XValues = "=Sheet1!$B$2"
ActiveChart.SeriesCollection(2).Values = "=Sheet1!$C$2"
ActiveChart.SeriesCollection(2).Select
ActiveChart.SeriesCollection(2).DataLabels.Select
Selection.ShowSeriesName = True
Selection.Position = xlLabelPositionAbove
ActiveChart.SeriesCollection(2).Select
With Selection
.MarkerStyle = 2
.MarkerSize = 7
ActiveChart.SeriesCollection(2).Select
With Selection.Format.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(192, 0, 0)
.Transparency = 0
.Solid
End With
Selection.Format.Line.Visible = msoFalse
End With

ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(3).Name = "=Sheet1!$A$3"
ActiveChart.SeriesCollection(3).XValues = "=Sheet1!$B$3"
ActiveChart.SeriesCollection(3).Values = "=Sheet1!$C$3"
ActiveChart.SeriesCollection(3).Select
ActiveChart.SeriesCollection(3).DataLabels.Select
Selection.ShowSeriesName = True
Selection.Position = xlLabelPositionAbove
ActiveChart.SeriesCollection(3).Select
With Selection
.MarkerStyle = 2
.MarkerSize = 7
ActiveChart.SeriesCollection(3).Select
With Selection.Format.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(192, 0, 0)
.Transparency = 0
.Solid
End With
Selection.Format.Line.Visible = msoFalse
End With