可以用函数来做一下为我写的一个取楼主说的那样的字符串,转化为数组的函数,参数str为字符串,参数sstr()为字符串数组(建议传引用)。返回值num为字符串数组的元素个数。
Function MidStr(str,sstr())
Dim tstr, mstr, tui
Dim i, num, j
num = 0
For i = 0 To Len(str)
tstr = Mid(str, i + 1, 1)
If tstr = "," Then
num = num + 1
End If
Next i
ReDim sstr(num)
j = 0
For i = 0 To Len(str)
tstr = Mid(str, i + 1, 1)
If tstr <> "," Then
mstr = mstr & tstr
Else
If j < num Then
sstr(j) = mstr
mstr = ""
j = j + 1
End If
End If
Next i
MidStr = num
End Function