Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo Fin
If Target.Count > 1 Or Target = "" Then Exit Sub
If Not Intersect(Target, [E6:E1000]) Is Nothing Then
Dim Ligne%: Ligne = Target.Row
If Cells(Ligne, "E") Mod 2 = 1 Then ' si nombre en colonne E pair
Cells(Ligne, "F") = Cells(Ligne, "A")
Range(Cells(Ligne + 1, "A"), Cells(Ligne, "E")).Interior.Color = xlNone
Range(Cells(Ligne, "A"), Cells(Ligne, "E")).Interior.Color = RGB(255, 255, 0)
Else
Cells(Ligne - 1, "F") = Cells(Ligne, "A")
Range(Cells(Ligne - 1, "A"), Cells(Ligne, "E")).Interior.Color = xlNone
Range(Cells(Ligne, "A"), Cells(Ligne, "E")).Interior.Color = RGB(255, 255, 0)
End If
End If
Fin:
End Sub