I have used InStrRev() in other modules without any problems. Any ideas about why this is occurring? Thanks
Code: Select all
Option Explicit
Option Compatible
Option VBASupport 1
Sub Main
ABC()
End Sub
Code: Select all
Option Explicit
Option Compatible
Option VBASupport 1
Sub Main
ABC()
End Sub
Code: Select all
Function InStrRev(s1 as String, s2 as String) as Integer
' Search s1 for the single character s2, going from right to left.
' Return the position of s2 in s1, or 0 if it is not found.
Dim i as Integer
for i = Len(s1) to 1 step -1
if Mid(s1,i,1) = s2 then
InStrRev() = i
Exit Function
end if
next i
InStrRev() = 0
End Function
Code: Select all
…
sometext.rfind(needle)
…