Hi! I would like to know how to display using a Spin Button different series in a chart
In the code that there is below this lines there are four series. I plot all of them together but I would like to keep the first one as it is, and be able to choose between the other series as it was one with the Spin Button. Any suggestion? Because I am a bit lost. Thanks in advance
THE CODE
Sub Fer()
Dim XA(1 To 4) As String
Dim XB(1 To 4) As String
Dim XC(1 To 4) As String
Dim i As Long
For i = 1 To 4
XA(i) = "='Sheet1'!R" & i + 1 & "C" & 1 & ""
XB(i) = "='Sheet1'!R" & i + 1 & "C" & 2 & ""
XC(i) = "='Sheet1'!R" & i + 1 & "C" & 3 & ""
Next i
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "=""Serie 1"""
ActiveChart.SeriesCollection(1).XValues = "='Sheet1'!$A$2:$A$5"
ActiveChart.SeriesCollection(1).Values = "='Sheet1'!$B$2:$B$5"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).Name = "=""Speed1"""
ActiveChart.SeriesCollection(2).XValues = XA(1)
ActiveChart.SeriesCollection(2).Values = XB(1)
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(3).Name = "=""Speed2"""
ActiveChart.SeriesCollection(3).XValues = XA(2)
ActiveChart.SeriesCollection(3).Values = XB(2)
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(4).Name = "=""Speed3"""
ActiveChart.SeriesCollection(4).XValues = XA(3)
ActiveChart.SeriesCollection(4).Values = XB(3)
End Sub
In the code that there is below this lines there are four series. I plot all of them together but I would like to keep the first one as it is, and be able to choose between the other series as it was one with the Spin Button. Any suggestion? Because I am a bit lost. Thanks in advance
THE CODE
Sub Fer()
Dim XA(1 To 4) As String
Dim XB(1 To 4) As String
Dim XC(1 To 4) As String
Dim i As Long
For i = 1 To 4
XA(i) = "='Sheet1'!R" & i + 1 & "C" & 1 & ""
XB(i) = "='Sheet1'!R" & i + 1 & "C" & 2 & ""
XC(i) = "='Sheet1'!R" & i + 1 & "C" & 3 & ""
Next i
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "=""Serie 1"""
ActiveChart.SeriesCollection(1).XValues = "='Sheet1'!$A$2:$A$5"
ActiveChart.SeriesCollection(1).Values = "='Sheet1'!$B$2:$B$5"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).Name = "=""Speed1"""
ActiveChart.SeriesCollection(2).XValues = XA(1)
ActiveChart.SeriesCollection(2).Values = XB(1)
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(3).Name = "=""Speed2"""
ActiveChart.SeriesCollection(3).XValues = XA(2)
ActiveChart.SeriesCollection(3).Values = XB(2)
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(4).Name = "=""Speed3"""
ActiveChart.SeriesCollection(4).XValues = XA(3)
ActiveChart.SeriesCollection(4).Values = XB(3)
End Sub