Paul,
Here ya go. It is only really noticable on very large strings.
Code:Function mySplit(strToSplt As String, strSplitOn As String) As String() Dim ip1 As Long, ip2 As Long Dim strArray() As String Dim iCount As Long ip1 = 1: ip2 = 1 Do ip2 = InStr(ip1, strToSplt, strSplitOn) If ip2 = 0 Then ip2 = Len(strToSplt) + 1 End If If iCount Mod 100 = 0 Then ReDim Preserve strArray(iCount + 100) As String End If strArray(iCount) = Mid$(strToSplt, ip1, ip2 - ip1) ip1 = ip2 + Len(strSplitOn) iCount = iCount + 1 Loop Until ip2 >= Len(strToSplt) ReDim Preserve strArray(iCount - 1) mySplit = strArray End Function




Reply With Quote