1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Sub test1()
Dim T, z As Variant, l As Collection, X As Long, i As Long, j As Long, temp As String
On Error Resume Next
Set l = New Collection
T = Range("A2:a" & Range("A65536").End(xlUp).Row)
For i = LBound(T) To UBound(T)
l.Add T(i, 1), T(i, 1): Next
For Each z In l
cbx1.AddItem z: Next
For i = 0 To cbx1.ListCount - 1
For j = 0 To cbx1.ListCount - 1
If cbx1.List(i) < cbx1.List(j) Then
temp = cbx1.List(i)
cbx1.List(i) = cbx1.List(j)
cbx1.List(j) = temp
End If: Next j: Next i
End Sub |
Partager