Article ID: 168836
Article Last Modified on 10/11/2006
Function InStrR(ByVal sTarget As String, _
ByVal sFind As String, _
ByVal iCompare As Long) As Long
Dim P As Long, LastP As Long, Start As Long
P = InStr(1, sTarget, sFind, iCompare)
Do While P
LastP = P
P = InStr(LastP + 1, sTarget, sFind, iCompare)
Loop
InStrR = LastP
End Function
?InStrR("The quick brown fox jumped over the lazy dog", "the", 0)
0 Binary comparison
1 Text comparison
2 Database Comparison (Microsoft Access)Keywords: kbhowto kbprogramming KB168836