Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C:C")) Is Nothing Then
On Error Resume Next
' Init N° à 1
[B5] = 1
'Ajoute numérotation automatique en colonne B
If Target.Value <> "" Then
Target.Offset(0, -1).Value = Target.Offset(-1, -1).Value + 1
End If
'Colorie en gris claire une ligne sur deux de la plage B5:J
Cells.FormatConditions.Delete
Range("B5:J" & Range("B1048576").End(xlUp).Row).Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LIGNE($B5)/2=ENT(LIGNE($B5)/2)"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.14996795556505
End With
Selection.FormatConditions(1).StopIfTrue = False
Target.Select ' Repositionnement du curseur en Target
End If
End Sub