TRIM Help !

N

Nikki

I have a column that has a name "Nikki" followed by 13 spaces. When I
concatenate the first name with the last, I have 13 spaces between the two
names. Is there a formula that will give me only the letters in the name and
remove the spaces?

Thanks for your help.

Nikki
 
J

Jacob Skaria

Just to ADD on

=LTRIM(" A ") or Left Trim will result in "A "
=RTRIM(" A ") or Right Trim will result in " A"
TRIM will do the trimming from both sides

If this post helps click Yes
 
D

Dave Peterson

Both ltrim and rtrim will work in code, but they're not functions built into
excel.

Maybe you have built your own UDF's to do this???
 
D

Don Guillett

And, just to add. I find that the code trims don't always work well so I
tend to use

application.trim(range("a1")) in my coding.
 
D

Dave Peterson

And just to add (squared, vbg):

the worksheet function application.trim() and VBA's trim function do different
things.

application.trim(" this is a test ")
would return
this is a test
(a single space between each word and leading/trailing spaces gone)


VBA's trim:
trim(" this is a test ")
would return
this is a test
(removing the leading/trailing spaces, but keeping multiple internal spaces)
 
Top