Place it within the appropriate sheet module

Private Sub Worksheet_Change(ByVal Target As Range)

If Selection.Count > 1 Then Exit Sub

Select Case UCase(Target)
    Case Is = "RED"
        Target.Interior.ColorIndex = 3
    Case Is = "YELLOW"
        Target.Interior.ColorIndex = 6
    Case Is = "GREEN"
        Target.Interior.ColorIndex = 4
End Select

End Sub