Table of contents
Collapse the table of content
Expand the table of content

InStrRev Function

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Description Returns the position of an occurrence of one string within another, from the end of string. SyntaxInstrRev( stringcheck,stringmatch [ ,start [ ,compare ]] ) The InstrRev function syntax has thesenamed arguments:

stringcheckRequired. String expression being searched.
stringmatchRequired. String expression being searched for.
startOptional. Numeric expression that sets the starting position for each search. If omitted, -1 is used, which means that the search begins at the last character position. If start containsNull, an error occurs.
compareOptional. Numeric value indicating the kind of comparison to use when evaluating substrings. If omitted, a binary comparison is performed. See Settings section for values.

Settings The compare argument can have the following values:

vbUseCompareOption-1Performs a comparison using the setting of the Option Compare statement.
vbBinaryCompare0Performs a binary comparison.
vbTextCompare1Performs a textual comparison.
vbDatabaseCompare2Microsoft Access only. Performs a comparison based on information in your database.

Return ValuesInStrRev returns the following values:

IfInStrRev returns
stringcheck is zero-length0
stringcheck is NullNull
stringmatch is zero-lengthstart
stringmatch is NullNull
stringmatch is not found0
stringmatch is found within stringcheckPosition at which match is found
start > Len( stringmatch )0

Remarks Note that the syntax for the InstrRev function is not the same as the syntax for the Instr function.

© 2018 Microsoft