Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$2" And Target.Count = 1 Then
If IsError(Application.Match(Target.Value, [choix1], 0)) Then
If MsgBox("On ajoute?", vbYesNo) = vbYes Then
[choix1].End(xlToRight).Offset(0, 1) = Target.Value
Else
Application.Undo
End If
Else
Target.Offset(0, 1) = Sheets("listes").Range("choix2")(1).Offset(1, Application.Match(Target, [choix1], 0) - 1)
End If
End If
If Target.Address = "$C$2" And Target.Count = 1 Then
d = Application.Match(Target.Offset(0, -1), [choix1], 0) - 1
If IsError(Application.Match(Target.Value, [choix2].Offset(0, d), 0)) Then
If MsgBox("On ajoute?", vbYesNo) = vbYes Then
n = Application.CountA([choix2].Offset(0, d))
c = Sheets("listes").Range("choix2").Column
Sheets("listes").Cells(n + 1, c + d) = Target.Value
Else
Application.Undo
End If
End If
End If
End Sub