Sub TestSpeedOfSubStringOccurences()
Dim T As Double, S As String, X As Long, L As Long, LngPos As Long
S = "ABBBBACCC"
Const SubString As String = "A"
T = Timer
For L = 0 To 10000000
X = Len(S) - Len(Replace$(S, SubString, vbNullString, 1, -1, vbBinaryCompare))
Next L
MsgBox "Replace Function: " & Timer - T
T = Timer
For L = 0 To 10000000
LngPos = 1
X = 0
Do
LngPos = InStrB(LngPos, S, SubString, vbBinaryCompare)
If LngPos > 0 Then
X = X + 1
LngPos = LngPos + 1
End If
Loop Until LngPos = 0
Next L
MsgBox "InStrB Function: " & Timer - T
End Sub