VBA - Rtrim


Advertisements

The Rtrim function removes the blank spaces from the right side of the string.

Syntax

RTrim(String)

Example

Add a button and add the following function.

Private Sub Constant_demo_Click()
   Dim var as Variant
   var =       "Microsoft VBScript           "
   msgbox("After Rtrim : " & RTrim(var))
End Sub

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

After Rtrim : Microsoft VBScript
vba_strings.htm
Advertisements