I am sure i have seen a speed test somewhere and the results showed Instr() within a loop won, correct me if i am wrong. Heres a function
casey.Code:Private Function CountStr(MainString As String, FindString As String) As Long Dim pos As Long Do pos = InStr(pos + 1, MainString, FindString) If pos Then CountStr = CountStr + 1 Else Exit Function End If Loop End Function




Reply With Quote