Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo LoiCT
If Not Intersect(Target, Range("B8:B500")) Is Nothing Then
If IsNumeric(Target) And (Target.Value >= 0 And Target.Value <= 10) Then
With Target.Offset(, 3)
If Target.Value < 6 Then
.Interior.ColorIndex = 3
.Value = 1
Else
.Interior.ColorIndex = 15
.Value = 2
End If
End With
End If
End If
Exit Sub
LoiCT:
End Sub