A
AmyTaylor
I have the following code, which looks at the cells BF9, BF10 etc and i
the corresponding cell J9, J10 etc is greater then cell G9, G10 et
changes colour.
What I really want is to use the Pcent value (ie: 5%) to make th
calculation a bit more complicated, whereby the value has to be 5
greater or 5% lower to trigger a change in the colours.
Sub TrafficLights()
Dim R As Integer
Dim Pcent As Integer
Pcent = 0.05
For R = 9 To 383 ' note the number range
If Range("BF" & R).Value < Range("J" & R).Value Then
Range("G" & R).Interior.Color = vbGreen
Else
Range("G" & R).Interior.Color = vbRed
End If
Next R
End Sub
I hope this makes sense, and hope someone can help me
Thank you
Amy x
the corresponding cell J9, J10 etc is greater then cell G9, G10 et
changes colour.
What I really want is to use the Pcent value (ie: 5%) to make th
calculation a bit more complicated, whereby the value has to be 5
greater or 5% lower to trigger a change in the colours.
Sub TrafficLights()
Dim R As Integer
Dim Pcent As Integer
Pcent = 0.05
For R = 9 To 383 ' note the number range
If Range("BF" & R).Value < Range("J" & R).Value Then
Range("G" & R).Interior.Color = vbGreen
Else
Range("G" & R).Interior.Color = vbRed
End If
Next R
End Sub
I hope this makes sense, and hope someone can help me
Thank you
Amy x