Consider a loop where you aggregate strings into a comma separated value string:
Dim Result As String
For Each Something In Things
If Result <> vbNullString Then
Result = Result & ","
End If
Result = Result & SomeStringFunction(Something)
Next Something
That works, but what if I only want distinct strings? I’ve been using this method, but it seems very “heavy-weight”:
Dim Dict As Dictionary
Set Dict = New Dictionary
For Each Something In Things
Dict(SomeStringFunction(Something)) = vbNullString
Next Something
Dim Result As String
Dim vKey As Variant
For Each vKey In Dict.Keys
If Result <> vbNullString Then
Result = Result & ","
End If
Result = Result & CStr(vKey)
Next vKey
Set Dict = Nothing
OK, dirty hack time: