Syntax
RTrim$(Source$)
Remarks
Returns Source$ minus any trailing spaces (spaces to the right of the last character). RTrim$() is especially useful for cleaning up user-defined variables before passing them to other parts of a macro.
Example
This example prompts the user for his or her last name and then removes extra spaces the user may have typed at the end of the name:
lastName$ = InputBox$("Please enter your last name.") lastName$ = RTrim$(lastName$)
See Also
InStr(), Left$(), LTrim$(), Mid$(), Right$()