Public Function Split(Str1 As String, Str2 As String) As Variant
Dim i As Integer Dim j As Integer Dim str1Temp As String Dim str2temp As String Dim TempVar() As Variant Dim TempVar2() As Variant ReDim TempVar2(10000) str1Temp = Str1 str2temp = Str2 While InStr(str1Temp, str2temp) <> 0 TempVar2(i) = Left(str1Temp, InStr(str1Temp, str2temp) - 1) str1Temp = Mid(str1Temp, InStr(str1Temp, str2temp) + 1, Len(str1Temp)) i = i + 1 Wend TempVar2(i) = str1Temp ReDim TempVar(i) For j = 0 To i TempVar(j) = TempVar2(j) Next Split = TempVar End Function |