1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Sub Curve()
Dim x As Range
Dim y As Range
Set b = Cells.Find("x", , xlValues, xlPart, , , False)
MsgBox b.Address
Set d = Cells.Find("y", , xlValues, xlPart, , , False)
MsgBox d.Address
Set x = Range(Cells(2, b.Column), Cells(20000, b.Column))
Set y = Range(Cells(2, d.Column), Cells(20000, d.Column))
Charts.Add
ActiveChart.ChartType = xlXYScatterSmoothNoMarkers
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "=""Cum. Planned"""
ActiveChart.SeriesCollection(1).Values = y
ActiveChart.SeriesCollection(1).XValues = x |
Partager