Try this function from
'Purpose : Converts a String to a 1 Dimensional Array.
'Inputs : ThisString. The string to convert.
' Delimiter. The item delimiter for the string.
'Outputs : ResultArray. The resulting array.
'Author : Andrew Baker
'Date : 25/03/2000
'Notes : Written as a Sub routine for speed.
Sub StringToArray(ByVal ThisString As String, ResultArray() As String, Optional Delimiter As String = ";", Optional TrimSpaces As Boolean)
Dim PosDelimiter As Long, LenString As Long, nItems As Long, OldPos As Long, LenDel As Long
LenString = Len(ThisString)
LenDel = Len(Delimiter)
If LenString Then
If Right$(ThisString, 1) <> Delimiter Then
ThisString = ThisString & Delimiter
End If
ReDim ResultArray(1 To LenString)
OldPos = 1
PosDelimiter = InStr(1, ThisString, Delimiter)
If TrimSpaces Then
Do While PosDelimiter
nItems = nItems + 1
ResultArray(nItems) = Trim$(Mid$(ThisString, OldPos, PosDelimiter - OldPos))
OldPos = PosDelimiter + LenDel
PosDelimiter = InStr(OldPos, ThisString, Delimiter)
Loop
Else
Do While PosDelimiter
nItems = nItems + 1
ResultArray(nItems) = Mid$(ThisString, OldPos, PosDelimiter - OldPos)
OldPos = PosDelimiter + LenDel
PosDelimiter = InStr(OldPos, ThisString, Delimiter)
Loop
End If
ReDim Preserve ResultArray(1 To nItems)
Else
Erase ResultArray
End If
End Sub
HTH
Ivan