Function Alphabetize(vStrings As Variant, separator As String) As String
Dim v As Variant, vSorted As Variant
Dim i As Long, j As Long, n As Long
Dim bDone As Boolean
For Each v In vStrings
n = n + 1
Next
ReDim vSorted(1 To n)
ReDim pos(1 To n)
For Each v In vStrings
i = i + 1
vSorted(i) = v
Next
For j = 2 To n
bDone = True
For i = 2 To n
If vSorted(i) < vSorted(i - 1) Then
v = vSorted(i - 1)
vSorted(i - 1) = vSorted(i)
vSorted(i) = v
bDone = False
End If
Next
If bDone Then Exit For
Next
For i = 1 To n
If vSorted(i) <> "" Then
If i = 1 Then
Alphabetize = separator & vSorted(i)
Else
If vSorted(i) <> vSorted(i - 1) Then Alphabetize = Alphabetize & separator & vSorted(i)
End If
End If
Next
Alphabetize = Mid$(Alphabetize, 2)
End Function
causes compiler error "CS1010 Newline in constant"