Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Target.Column < 5 And Target.Column > 8 Then Exit Sub
Dim m, n, o, p, x, v
Dim arr
Target.Interior.ColorIndex = xlNone
arr = Range("j3:x" & Range("j65536").End(xlUp).Row)
For x = 1 To UBound(arr)
If Cells(Target.Row, 3) >= arr(x, 1) And Cells(Target.Row, 3) <= arr(x, 2) And Cells(Target.Row, 4) = arr(x, 3) Then
m = arr(x, Choose(Target.Column - 5, 4, 8, 12))
n = arr(x, Choose(Target.Column - 5, 5, 9, 13))
o = arr(x, Choose(Target.Column - 5, 6, 10, 14))
p = arr(x, Choose(Target.Column - 5, 7, 11, 15))
End If
Next x
v = Target.Value
If v < n And v > o Then
Target.Interior.ColorIndex = 6
ElseIf v < m Or v > p Then
Target.Interior.ColorIndex = 3
End If
If Target = "" Then Target.Interior.ColorIndex = xlNone
End Sub