Hi,
Have an UserForm with a ListBox (Excel) containing unique values from colmn B. I cannot do that manually, because it is linked with colmn A (leading). How do I sort the values in the ListBox? Mij code so far:
i = 1
With ComboBox2
Do Until Sheets("DB").Cells(i, 1).Value = Empty
.AddItem Sheets("DB").Cells(i, 1).Value
i = i + 1
Loop
For i = .ListCount - 1 To 1 Step -1
If .List(i) = .List(i - 1) Then .RemoveItem (i)
Next
End With
Greets Jajinder
Have an UserForm with a ListBox (Excel) containing unique values from colmn B. I cannot do that manually, because it is linked with colmn A (leading). How do I sort the values in the ListBox? Mij code so far:
i = 1
With ComboBox2
Do Until Sheets("DB").Cells(i, 1).Value = Empty
.AddItem Sheets("DB").Cells(i, 1).Value
i = i + 1
Loop
For i = .ListCount - 1 To 1 Step -1
If .List(i) = .List(i - 1) Then .RemoveItem (i)
Next
End With
Greets Jajinder