Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 4 And Target.Count = 1 Then
If Target <> "" Then
If IsError(Application.Match(Target.Value, [Libellés], 0)) Then
Dim L%, C%
If MsgBox("On ajoute?", vbYesNo) = vbYes Then
L = Application.Match(Cells(Target.Row, "C"), Sheets("Libellés").Range("A:A"), 0)
C = Application.CountIf(Sheets("Libellés").Range(L & ":" & L), "*")
Sheets("Libellés").Cells(L, C + 1) = Target
Sheets("Libellés").Range("B" & L & ":ZZ" & L).Sort Key1:=Sheets("Libellés").Range("B" & L), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlSortRows, DataOption1:=xlSortNormal
Else
Application.Undo
End If
End If
End If
End If
End Sub