the function " =TRIM( )"

A

Ace

The above formula does not seem to work with text. I still
have spaces in the text. I have tried LTRIM and RTRIM, but
same result.
 
D

Dave Peterson

=trim() removes duplicated internal spaces and leading and trailing spaces.

If you want to get rid of all the spaces:
=substitute(a1," ","")

But if you've copied from a web page, you could have those non-breaking spaces
(char(160)).

If you've got lots of these to clean up, I'd use David McRitchie's subroutine:

http://www.mvps.org/dmcritchie/excel/join.htm#trimall
(look for "Sub Trimall()")

If you're new to macros, you may want to read David's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
G

Gord Dibben

Ace

The TRIM Function gets rid of extraneous spaces, like leading and following
but leaves a single space between words.

What are you attempting to do?

The spaces could be html non-printing spaces or something else.

Where does the text come from? Imported?

More details needed please.

Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top