The VBA STRREVERSE function is listed under the text category of VBA functions. When you use it in a VBA code, it returns a string by reversing the original string supplied. In simple words, if you supply the string “Hello” it will return “olleh” in the result.
Contents hide
Syntax
StrReverse(Expression)
Arguments
- Expression: The string which you want to reverse.
Example
To practically understand how to use VBA STRREVERSE function, you need to go through the below example where we have written a vba code by using it:
Sub example_STRREVERSE()
Range("B1").Value = StrReverse(Range("A1"))
End Sub
In the above code, we have used the STRREVERSE to reverse the text from the cell A1 and return the result in the cell A1.
Related Functions
FORMAT | INSTR | INSTRREV | LCASE | LEFT | LEN | LTRIM | MID | REPLACE | RIGHT | RTRIM | SPACE | STRCOMP | STRCONV | STRING | TRIM | UCASE