Public Function FindLast(ByVal source As String, ByVal _
target As String, Optional start_at As Integer = 1) As _
Integer
Dim pos As Integer
' Assume we won't find it.
FindLast = 0
' Search for the target.
pos = InStr(start_at, source, target)
Do While pos > 0
FindLast = pos
pos = InStr(pos + 1, source, target)
Loop
End Function
|