Hi
Conditional Formatting:
Highlight the range E2:G2, Conditional Formatting, use a formula and enter the following
=AND($E2<=$F2,$E2>=$G2), Fill as Green
=OR($E2>$F2,$E2<$G2), Fill as Red
Worksheet Change Event
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row >= 2 And Target.Column >= 5 And Target.Column <= 7 Then
If Cells(Target.Row, "E") > Cells(Target.Row, "F") Or Cells(Target.Row, "E") < Cells(Target.Row, "G") Then
Cells(Target.Row, "E").Resize(1, 3).Interior.ColorIndex = 3
Else
Cells(Target.Row, "E").Resize(1, 3).Interior.ColorIndex = 4
End If
End If
End Sub
rylo
Bookmarks