Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Test InsTr vs InStrRev for VBA:
- Option Explicit
- Sub test()
- Dim testString As String
- testString = "123.456.789"
- Dim inStrIndex As Long
- inStrIndex = InStr(1, testString, ".")
- Dim inStrRevIndex As Long
- inStrRevIndex = InStrRev(testString, ".")
- Debug.Print "Find ""."" in """ & testString & """"
- Debug.Print "InStr: " & inStrIndex
- Debug.Print "InStrRev: " & inStrRevIndex
- End Sub
- Output:
- Find "." in "123.456.789"
- InStr: 4
- InStrRev: 8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement