Private Sub Worksheet_Change(ByVal Target As Range)
Dim d As Object, t, date1, date2, i&
If Intersect(Target, Union(Me.ListObjects(1).Range, Range("H2"))) Is Nothing Then Exit Sub
On Error GoTo FIN: Application.ScreenUpdating = False
t = Range("tableau1")
Set d = CreateObject("scripting.dictionary"): d.comparemode = vbTextCompare
date1 = Range("h3"): date2 = Range("i3")
For i = 1 To UBound(t)
If Trim(t(i, 5)) <> "" And t(i, 2) >= date1 And t(i, 2) <= date2 Then d(t(i, 5)) = d(t(i, 5)) + 1
Next i
Application.EnableEvents = False
Range(Range("g5"), Cells(Rows.Count, "h")).Clear
Range("g5") = ActiveSheet.ListObjects(1).HeaderRowRange(1, 5): Range("h5") = "Quantité"
Range("g6").Resize(d.Count) = Application.Transpose(d.keys)
Range("h6").Resize(d.Count) = Application.Transpose(d.items)
Range("g5:h5").Resize(d.Count + 1).Sort key1:=Range("h5"), order1:=xlDescending, key2:=Range("g5"), order1:=xlAscending, Header:=xlYes
Me.ListObjects.Add(xlSrcRange, Range("g5:h5").Resize(d.Count + 1), , xlYes).Name = "Tableau2"
FIN: Application.EnableEvents = True
End Sub