Below is the code im using to populate a combo box with unique items only:
Private Sub UserForm_Initialize()
DivisionBox.Clear
Dim LastRow As Long
Dim Rng As Range
Dim Cell As Range
LastRow = Sheets("Active Branch List").Range("B" & Rows.Count).End(xlUp).Row
Set Rng = Sheets("Active Branch List").Range("B3:B" & LastRow)
With CreateObject("Scripting.Dictionary")
For Each Cell In Rng
If Not .exists(Cell.Value & "-" & Cell.Offset(0, 1).Value) Then
.Add Cell.Value & "-" & Cell.Offset(0, 1).Value, Nothing
End If
Next Cell
DivisionBox.List = .keys
End With
End Sub
this works perfectly, except i would like the keys to be sorted A to Z before being added to the combo box. I've searched for solutions but can't seem to work them into the code i already have.