Be the first user to complete this post

  • 0
Add to List

VBA-Excel: String Functions – LTrim()

Description: 

The LTrim function removes spaces on the left side of a string.

Format:

Ltrim (strMainString)

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

Function FnLTrim()
     Dim strMainString

     strMainString = "   Sumit Jain  "

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

End Function 
Ltrim
Ltrim

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: String Functions – String()
  2. VBA-Excel: Date-Time Functions – Day()
  3. VBA-Excel: Date-Time Functions – IsDate()
  4. VBA-Excel: Array Functions – LBound and UBound()
  5. VBA-Excel: Date-Time Functions – DateDiff()
  6. VBA-Excel: Get all the WeekDays or Working days in Specified Date Range, (excluding Satudays and Sundays)
  7. VBA-Excel : Strings Functions – Ucase
  8. VBA-Excel: Fill Excel Range Values in a 2D Array