Tri sur liste code postal d'une listbox

Bonjour,

j'ai un code qui m'affiche dans une listbox des codes postaux, je souhaiterai les trier par ordre croissant, voici le code qui m'affiche cette listbox

Dim i As Integer

ListBox2.Clear

For i = 2 To Range("E1000").End(xlUp).Row
If UCase(Left(Cells(i, 5), Len(TextBoxCodepostalClient.Text))) = UCase(TextBoxCodepostalClient.Text) Then
ListBox2.AddItem Cells(i, 5)
End If
Next i

Pouvez-vous m'aider à trier cette listbox par ordre croissant ? Merci

Je viens de trouver le code ci dessous qui a l'air de fonctionner

Dim i As Long
Dim j As Long
Dim k As Variant

ReDim sTemp(UBound(Me.ListBox2.List, 1))
With Me.ListBox2
For j = LBound(.List) To UBound(.List) - 1 Step 1
For i = LBound(.List) To UBound(.List) - 1 Step 1
If .List(i) > .List(i + 1) Then 'Regle du tri
For k = 0 To .ColumnCount - 1
sTemp(k) = .List(i + 1, k) 'tri bulle
.List(i + 1, k) = .List(i, k)
.List(i, k) = sTemp(k)
Next k
End If
Next i
Next j
End With

Rechercher des sujets similaires à "tri liste code postal listbox"