1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| Private Sub UserForm_Initialize()
Dim T, z As Variant, l As Object, i As Long, j As Long, temp As String
On Error Resume Next
Set l = CreateObject("Scripting.Dictionary")
T = Range("d10:d" & Range("d65536").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
Set l = CreateObject("Scripting.Dictionary")
T = Range("e10:e" & Range("e65536").End(xlUp).Row)
For i = LBound(T) To UBound(T)
l.Add T(i, 1), T(i, 1): Next
For Each z In l
cbx2.AddItem z: Next
For i = 0 To cbx2.ListCount - 1
For j = 0 To cbx2.ListCount - 1
If cbx2.List(i) < cbx2.List(j) Then
temp = cbx2.List(i)
cbx2.List(i) = cbx2.List(j)
cbx2.List(j) = temp
End If: Next j: Next i
Set l = CreateObject("Scripting.Dictionary")
T = Range("f10:f" & Range("f65536").End(xlUp).Row)
For i = LBound(T) To UBound(T)
l.Add T(i, 1), T(i, 1): Next
For Each z In l
cbx3.AddItem z: Next
For i = 0 To cbx3.ListCount - 1
For j = 0 To cbx3.ListCount - 1
If cbx3.List(i) < cbx3.List(j) Then
temp = cbx3.List(i)
cbx3.List(i) = cbx3.List(j)
cbx3.List(j) = temp
End If: Next j: Next i
Set l = CreateObject("Scripting.Dictionary")
T = Range("l10:l" & Range("l65536").End(xlUp).Row)
For i = LBound(T) To UBound(T)
l.Add T(i, 1), T(i, 1): Next
For Each z In l
cbx4.AddItem z: Next
For i = 0 To cbx4.ListCount - 1
For j = 0 To cbx4.ListCount - 1
If cbx4.List(i) < cbx4.List(j) Then
temp = cbx4.List(i)
cbx4.List(i) = cbx4.List(j)
cbx4.List(j) = temp
End If: Next j: Next i
End Sub |
Partager