Be the first user to complete this post

  • 0
Add to List

VBA-Excel: String Functions – RTrim()

Description: 

The RTrim function removes spaces on the right side of a string.

Format:

Rtrim (strMainString)

Arguments:
  • strMainString
    • Mandatory
    • Type: String
    • String whose right space needs to be trimmed.

Function FnRTrim()

    Dim strMainString

    strMainString = "   Sumit Jain  "

     MsgBox "Before : '" & strMainString & "' and after right Space is trimmed. After :'" &                                             RTrim(strMainString) & "'"

End Function 
Rtrim
Rtrim

Also Read About  Other String() Functions

INSTR()                       |                         InstrREV()                       |                        LCase()

UCase()                      |                         Left()                                |                        Right()

LTrim()                        |                         Mid()                                 |                        Trim()

RTrim()                       |                        Replace()                          |                        Space()

Len()                           |                        StrComp()                         |                        String()



Also Read:

  1. VBA-Excel: Date-Time Functions - Timer()
  2. VBA-Excel: Date-Time Functions – IsDate()
  3. VBA-Excel: Date-Time Functions – Hour(), Minute(), Second()
  4. VBA-Excel : 3D-Ranges - Working with Multiple WorkSheets At The Simultaneously
  5. VBA-Excel: Select and Activate Cells - Activate