Don't know if this is any use to you but it's something I use that's similar to what you are trying to achieve but using a collection rather than an array which has the advantage of only accepting unique items as well:
Sub Refresh_List()
Dim AllCells As Range, Cell As Range
Dim NoDupes As New Collection
Dim i As Integer, j As Integer
Dim Swap1, Swap2, Item
With ActiveSheet
Set AllCells = .Range("A2:A" & .Cells(Rows.Count, 1).End(xlUp).Row)
End With
' The next statement ignores the error caused
' by attempting to add a duplicate key to the collection.
On Error Resume Next
For Each Cell In AllCells
NoDupes.Add Cell.Value, CStr(Cell.Value)
' Note: the 2nd argument (key) for the Add method must be a string
Next Cell
' Resume normal error handling
On Error GoTo 0
' Sort the collection
For i = 1 To NoDupes.Count - 1
For j = i + 1 To NoDupes.Count
If NoDupes(i) > NoDupes(j) Then
Swap1 = NoDupes(i)
Swap2 = NoDupes(j)
NoDupes.Add Swap1, before:=j
NoDupes.Add Swap2, before:=i
NoDupes.Remove i + 1
NoDupes.Remove j + 1
End If
Next j
Next i
' Add the sorted, non-duplicated items to a ComboBox
For Each Item In NoDupes
ComboBox4.AddItem Item
Next Item
End Sub
Dom
Bookmarks