LTRIM() Function VBA: To Remove Spaces

Posted: May 10, 2013 by Theodoulus in VBA
Tags: , ,

In VBA, LTRIM() function is used to remove the leading spaces from the given string.

Syntax:
The syntax for LTRIM() function is
LTRIM(text)

 text is the String that you wish to remove the leading spaces from.

Example:

Ltrim(“                  UsefulGyaan”)                      ‘ returns  “UsefulGyaan”
Ltrim(“                 UsefulGyaan          “)             ‘ returns  “UsefulGyaan          “
Ltrim(“UsefulGyaan          “)                             ‘ retruns “UsefulGyaan          “

Note: – LTRIM() function doesn’t remove the spaces between or after the string.

Advertisements

Share your thoughts/feedback

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s