Currently I have:
Private Sub Worksheet_Calculate()
ActiveSheet.ChartObjects("Chart").Activate
Dim ch As Chart
Set ch = ActiveChart
If Range("D4").Value = 0 Then
ch.SeriesCollection("Series1").Format.Line.ForeColor.RGB = RGB(255, 255, 255)
ElseIf Range("D4").Value > 2 Then
ch.SeriesCollection("Series1").Format.Line.ForeColor.RGB = RGB(0, 255, 0)
ElseIf Range("D4").Value <= 2 And Range("D4").Value >= 1 Then
ch.SeriesCollection("Series1").Format.Line.ForeColor.RGB = RGB(0, 200, 0)
ElseIf Range("D4").Value < -2 Then
ch.SeriesCollection("Series1").Format.Line.ForeColor.RGB = RGB(255, 0, 0)
ElseIf Range("D4").Value < 0 And Range("D4").Value >= -1 Then
ch.SeriesCollection("Series1").Format.Line.ForeColor.RGB = RGB(200, 0, 0)
Else
ch.SeriesCollection("Series1").Format.Line.ForeColor.RGB = RGB(0, 0, 0)
End If
End Sub
Which looks at a value in D4 and if D4 is between my bounds, it assigns the chart series a certain color (this value is not on the chart but rather an indicator used to classify the charts movement).
I want to loop this through 10 different Chart Series Collections, where in each Loop, I go down one cell. so go to Cell D5 check all conditions for Series 2, then Cell D6, check all conditions for Series 3
I am stuck here as I know how to do this for one half of this, but unsure how to loop into chartseries
user26829351 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.