Hello,
I'm using WinXP Pro, Office XP SP2.
I'm using the following code (below) to parse through a string variable
(sPage) that contains line breaks [chr(10)]. However, even though it
loops between 10,000 and 11,000 times, it seems to run slow. Can
someone please give me an idea on how I can make this code more
efficient, or suggest another method?
Thanks.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rLen = Len(sPage)
S = 1
For x = 1 To 11000
If S < rLen Then
h = InStr(IIf(S = 1, S, S + 1), sPage, Chr(10), vbTextCompare)
Worksheets("Data").Range(sLoc).Offset(x - 1, 0).value = _
Mid(sPage, IIf(S = 1, S, S + 1), h - (S + 1))
S = h
Else
Exit For
End If
Next x
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bookmarks