ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   remove tail spaces (https://www.excelbanter.com/excel-worksheet-functions/106672-remove-tail-spaces.html)

RichHoughton

remove tail spaces
 
Hi

I'm trying to remove spaces from the end of text without success. A cell
contains for example: The(space)Cat(space)Sat(space)(space)(space)(space )
What i want is: The(space)Cat(space)Sat

What i am trying to do is search from the right, the first non-space
character, get it's position value in the overall cell length and with the
use of the Len function, remove all spaces after the final character. Please
note that the number of words in each text piece vary.

Any ideas please?
Rich

Bob Phillips

remove tail spaces
 
=TRIM(A1)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"RichHoughton" wrote in message
...
Hi

I'm trying to remove spaces from the end of text without success. A cell
contains for example: The(space)Cat(space)Sat(space)(space)(space)(space )
What i want is: The(space)Cat(space)Sat

What i am trying to do is search from the right, the first non-space
character, get it's position value in the overall cell length and with the
use of the Len function, remove all spaces after the final character.

Please
note that the number of words in each text piece vary.

Any ideas please?
Rich




RichHoughton

remove tail spaces
 
Brilliant, thanks

"Bob Phillips" wrote:

=TRIM(A1)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"RichHoughton" wrote in message
...
Hi

I'm trying to remove spaces from the end of text without success. A cell
contains for example: The(space)Cat(space)Sat(space)(space)(space)(space )
What i want is: The(space)Cat(space)Sat

What i am trying to do is search from the right, the first non-space
character, get it's position value in the overall cell length and with the
use of the Len function, remove all spaces after the final character.

Please
note that the number of words in each text piece vary.

Any ideas please?
Rich






All times are GMT +1. The time now is 03:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com