Private Sub Workbook_SheetselectionChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column >= 5 And Target.Column <= 10 And (Cells(Target.Row, "A") <> "" Or Cells(Target.Row, "B") <> "") Then
Select Case Target
Case "": Rouge Target.Address
Case "NR": Vert Target.Address
Case "R": Blanc Target.Address
Case ".": Rouge Target.Address
End Select
Cells(Target.Row, "A").Select
End If
End Sub
Sub Rouge(Cell)
With Range(Cell)
Selection = "NR"
.Font.Color = RGB(255, 0, 0): .Interior.Color = RGB(255, 220, 220): .Font.Bold = True
End With
End Sub
Sub Vert(Cell)
With Range(Cell)
Selection = "R"
.Font.Color = RGB(0, 176, 80): .Interior.Color = RGB(220, 255, 220): .Font.Bold = True
End With
End Sub
Sub Blanc(Cell)
With Range(Cell)
Selection = "."
.Font.Color = RGB(255, 255, 255): .Interior.Color = xlNone
End With
End Sub