Option Explicit
Public NbLi As Integer, i As Integer, Opt
Private Sub Worksheet_Change(ByVal Target As Range)
NbLi = [A65536].End(xlUp).Row
For i = 2 To 9
If Cells(65536, i).End(xlUp).Row > NbLi Then NbLi = Cells(65536, i).End(xlUp).Row
Next
If Not Intersect(Target, Range("C2:C" & NbLi)) Is Nothing Then
Application.EnableEvents = False
i = Target.Row
If Cells(i, 3) = "Confirmé" Then
Opt = Cells(i, 1) & Cells(i, 4) & Cells(i, 6) & Cells(i, 8)
Range("A" & i & ",D" & i & ",F" & i & ",H" & i).ClearContents
Cells(i, 4) = Opt
Opt = Cells(i, 2) & Cells(i, 5) & Cells(i, 7) & Cells(i, 9)
Range("B" & i & ",E" & i & ",G" & i & ",I" & i).ClearContents
Cells(i, 5) = Opt
ElseIf Cells(i, 3) = "Annulé" Then
Opt = Cells(i, 1) & Cells(i, 4) & Cells(i, 6) & Cells(i, 8)
Range("A" & i & ",D" & i & ",F" & i & ",H" & i).ClearContents
Cells(i, 6) = Opt
Opt = Cells(i, 2) & Cells(i, 5) & Cells(i, 7) & Cells(i, 9)
Range("B" & i & ",E" & i & ",G" & i & ",I" & i).ClearContents
Cells(i, 7) = Opt
ElseIf Cells(i, 3) = "Refusé" Then
Opt = Cells(i, 1) & Cells(i, 4) & Cells(i, 6) & Cells(i, 8)
Range("A" & i & ",D" & i & ",F" & i & ",H" & i).ClearContents
Cells(i, 8) = Opt
Opt = Cells(i, 2) & Cells(i, 5) & Cells(i, 7) & Cells(i, 9)
Range("B" & i & ",E" & i & ",G" & i & ",I" & i).ClearContents
Cells(i, 9) = Opt
End If
Application.EnableEvents = True
End If
End Sub