I would like to remove duplicates in my listbox

Hello

I would like to delete the duplicates in my listbox but I have a bug that I can't seem to solve.

It does remove me from it but after a while it bugs.

Hello. Try this:

For i = 0 To Fournisseur.ListCount - 1
    For j = Fournisseur.ListCount - 1 To i + 1 Step -1
        If Fournisseur.List(j) = Fournisseur.List(i) Then Fournisseur.RemoveItem j
    Next j
Next i

 

2 Likes