VBA – Rtrim

  • Post author:
  • Post category:VBA
  • Post comments:0 Comments
 Rtrim function

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

Previous Page:-Click Here

Leave a Reply