I am trying to automate the plotting process.
Simply I think I am missing the quotation marks around the Range but I do not know how put them in with an "&" sign.
The error code is: "Parameter not Valid"
If it is not the quotation marks maybe it is something ele I am missing.
Here is my code:
Code
Max = Sheets("PlotData").Cells(Rows.Count, 3).End(xlUp).Row - 3
nn = 1
Names(2) = "Mercury"
Names(3) = "Venus"
Names(4) = "Earth"
Names(5) = "Mars"
Names(6) = "Jupiter"
Names(7) = "Saturn"
Names(8) = "Mercury"
Names(10) = "Uranus"
Names(11) = "Mercury"
Names(12) = "Neptune"
Names(13) = "Pluto"
Names(14) = "Ceres"
Names(15) = "Pallas"
Names(16) = "Vesta"
For k = 2 To 16
Sheets("Graph").ChartObjects("Chart 1").Chart.SeriesCollection(k).XValues = Sheets("PlotData").Range(Hex(nn) & k +3 & ":" & Hex(nn) & Max)
nn = nn + 1
Sheets("Graph").ChartObjects("Chart 1").Chart.SeriesCollection(k).Values = Sheets("PlotData").Range(Hex(nn) & k + 3 & ":" & Hex(nn) & Max)
nn = nn + 1
Sheets("Graph").ChartObjects("Chart 1").Chart.SeriesCollection(k).Interior.Color = RGB(255, 0, 0)
Sheets("Graph").ChartObjects("Chart 1").Chart.SeriesCollection(k).Name = Names(k)
Next k
Display More