Private Sub Label3_Click()
Dim d As Object, i&, P As Range, t, affiche As Range
Set d = CreateObject("Scripting.Dictionary")
With ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) Then d(.List(i, 0)) = ""
Next
End With
Set P = [A2:A300001]
t = P 'matrice, plus rapide
For i = 1 To UBound(t)
If d.exists(t(i, 1)) Then Set affiche = Union(IIf(affiche Is Nothing, P(i), affiche), P(i))
Next
Application.ScreenUpdating = False
P.Rows.Hidden = True 'masque toute les lignes
If Not affiche Is Nothing Then affiche.Rows.Hidden = False 'affiche les valeurs sélectionnées
Application.ScreenUpdating = True
End Sub
Private Sub UserForm_Initialize()
Dim t, d As Object, i&, a, b
t = [A2:A300001] 'matrice, plus rapide
Set d = CreateObject("Scripting.Dictionary")
For i = 1 To UBound(t)
d(t(i, 1)) = d(t(i, 1)) + 1 'comptage
Next
a = d.keys: b = d.items
ReDim t(UBound(a), 1)
For i = 0 To UBound(t)
t(i, 0) = a(i)
t(i, 1) = b(i)
Next
ListBox1.List = t
End Sub