Sub Command1_Click()
Call ConvertList (List1, "gul|röd|blå","|", True)
debug.print ConvertList (List1, "","/")
End Sub
Function ConvertList(cList As Control, ByVal sText As _
String, ByVal sDelimeter As String, Optional bClear As _
Boolean = False) As String
Dim iLoop As Long
Dim iFind As Long
If Len(sText) Then
If bClear Then cList.Clear
Do
iFind = InStr(sText, sDelimeter)
If iFind Then
sList = AddItem Left(sText, iFind - 1 )
sText = Mid(sText, iFind + 1)
End If
Loop Until iFind = 0
If Len(sText) Then cList.AddItem cText
Else
For iLoop = 0 To cList.ListCount -1
If iLoop = cList.ListCount -1 Then
sDelimeter = vbNullString
ConvertList = ConvertList & cList.List(iLoop) _
& sDelimeter
Next iLoop
End If
End Function