Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal r As Range)
If Not Sh.Name Like "*_Dispatch*" Then Exit Sub
Dim nom$, post$, i As Variant, j%
With Feuil10 'CodeName de la feuille POSTING, à adapter
For Each r In r 'si entrées/effacements multiples
nom = Application.Trim(r) 'SUPPRESPACE, sécurité
post = r(2 - r.Row) & " / " & r(1, 2 - r.Column)
If nom = "" Then 'effacement
For i = 2 To .UsedRange.Rows.Count
j = .Cells(i, .Columns.Count).End(xlToLeft).Column 'dernière cellule à droite
If .Cells(i, j) = post Then
.Cells(i, j) = ""
If j = 2 Then .Cells(i, 1) = ""
Exit For
End If
Next i
Else
i = Application.Match(nom, .Columns(1), 0)
If IsError(i) Then i = Application.CountA(.Columns(1)) + 1
.Cells(i, 1) = nom
j = .Cells(i, .Columns.Count).End(xlToLeft).Column 'dernière cellule à droite
If .Cells(i, j) <> post Then .Cells(i, j + 1) = post: .Cells(1, j + 1) = "POSTING " & j
End If
Next r
With .UsedRange
.WrapText = False
.Columns.AutoFit 'ajustement largeur
.Sort .Cells(1), xlAscending, Header:=xlYes 'tri
End With
End With
End Sub