Sub 宏1()
'
' 宏1 宏
'
'
Dim i
Range("O2:Y12,E2:N12").Select
ActiveSheet.Shapes.AddChart2(240, xlXYScatterSmooth).Select
ActiveChart.SetSourceData Source:=Range("Sheet2!$E$2:$Y$2"), PlotBy:=xlRows
a = 2
b = 200
For i = a To b
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(i - 1 - a + 2).XValues = "=Sheet2!$" & "E$" & i & ":$N$" & i
ActiveChart.SeriesCollection(i - 1 - a + 2).Values = "=Sheet2!$" & "P$" & i & ":$Y$" & i
ActiveChart.SeriesCollection(i - 1 - a + 2).Name = "=Sheet2!$" & "O$" & i
Next i
End Sub
补充一下循环的代码
Sub 宏1()
'