Private Sub Worksheet_Activate()
Filtre [B1], [colA], [col], [A4]
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [B1,B3]) Is Nothing Then _
Filtre [B1], [colA], [col], [A4]
End Sub
Sub Filtre(critere&, colA As Range, col As Range, deb As Range)
Dim col1, col2, t(), d As Object, i&, n&
col1 = colA.Resize(colA.Count + 1) 'matrice, au moins 2 éléments
col2 = col.Resize(UBound(col1))
ReDim t(1 To UBound(col1), 1 To 2)
Set d = CreateObject("Scripting.Dictionary")
For i = 1 To UBound(t) - 1
If Not d.exists(col1(i, 1)) Then _
d(col1(i, 1)) = Application.SumIf(colA, col1(i, 1), col) 'SOMME.SI
If d(col1(i, 1)) > critere Then
n = n + 1
t(n, 1) = col1(i, 1)
t(n, 2) = col2(i, 1)
End If
Next
'---restitution---
If n Then deb.Resize(n, 2) = t
deb.Offset(n).Resize(Rows.Count - deb.Row - n + 1, 2).ClearContents
End Sub