1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Private Sub UserForm_Activate()
Dim Tablo As Variant, Tempo As Variant, i As Long, j As Long
Worksheets("Feuil1").Activate 'à défaut d'instancier la feuille
Tablo = Range("a2:a" & Range("a" & Rows.Count).End(xlUp).Row).Value
'triAlpha
For i = 1 To UBound(Tablo)
For j = 1 To UBound(Tablo)
If Tablo(i, 1) < Tablo(j, 1) Then
Tempo = Tablo(i, 1)
Tablo(i, 1) = Tablo(j, 1)
Tablo(j, 1) = Tempo
End If
Next j
Next i
'Remplissage excluant les doublons
ListBox1.AddItem Tablo(1, 1)
For i = 2 To UBound(Tablo)
If Tablo(i, 1) <> Tablo(i - 1, 1) Then ListBox1.AddItem Tablo(i, 1)
Next
End Sub |
Partager