Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Contact us
Hide Buttons

VBA-Excel: String Functions – LTrim()


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


Ltrim (strMainString)

  • 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 



Also Read About  Other String() Functions

INSTR()                       |                         InstrREV()                       |                        LCase()

UCase()                      |                         Left()                                |                        Right()

LTrim()                        |                         Mid()                                 |                        Trim()

RTrim()                       |                        Replace()                          |                        Space()

Len()                           |                        StrComp()                         |                        String()

Happy Macro­ing :)

Sumit Jain

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: