I found a code that sorts a userform listbox alphabetically.
Was wondering if there is a way to first sort all the selections alphabetically witht he first selections at be displayed at the top of the list box and then all the unselected items (already in alphabetical order) to be displed below all the selections?
I know i'm way off but i tried the best i could, see below:
Dim i As Long
Dim j As Long
Dim temp As Variant
With Me.BrandListBox
For j = 0 To BrandListBox.ListCount - 2
For i = 0 To BrandListBox.ListCount - 2
If .Selected(i) = True Then
If .List(i) > .List(i + 1) Then
temp = .List(i)
.List(i) = .List(i + 1)
.List(i + 1) = temp
End If
End If
Next i
Next j
End With
I really would appreciate any help on this.
Bookmarks