VBA - String Reverse Function



The StrReverse function reverses the specified string.

Syntax

StrReverse(string) 

Example

Add a button and add the following function.

Private Sub Constant_demo_Click()
   msgbox("Line 1 : " & StrReverse("VBSCRIPT"))
   msgbox("Line 2 : " & StrReverse("My First VBScript"))
   msgbox("Line 3 : " & StrReverse("123.45"))
End Sub

When you execute the above function, it produces the following output.

Line 1 : TPIRCSBV
Line 2 : tpircSBV tsriF yM
Line 3 : 54.321
vba_strings.htm
Advertisements