Hi there,

So here's my second question of the afternoon..................

I'm creating an array of unique words based on another list passed to the
procedure (see code below). This works ok but I'd like to resize the
resulting array (vUniqueList) to be the same number as the elements that are
not empty. So can anyone tell me if there's a way of doing this without
iterating through the array to test for empty elements?

Best regards

John



'--------------------------
'Sample passed as parameter
Dim sWordLists As String
sWordLists = "Carrot%Carrot%Rabbit"
'--------------------------

Dim itm As Variant
Dim vUniqueList As Variant

ReDim vUniqueList(UBound(Split(sWordLists, "%"))) As Variant

'Get unique list
For Each itm In Split(sWordLists, "%")
For i = 0 To UBound(vUniqueList)
If IsEmpty(vUniqueList(i)) = True Then
vUniqueList(i) = itm
Exit For
Else
If itm = vUniqueList(i) Then
Exit For
End If
End If
Next i
Next itm