ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   I can't seem to use RTRIM or LTRIM in Excel 2002. I want to trim. (https://www.excelbanter.com/new-users-excel/4556-i-cant-seem-use-rtrim-ltrim-excel-2002-i-want-trim.html)

Pam

I can't seem to use RTRIM or LTRIM in Excel 2002. I want to trim.
 
3 characters off the right side of a string and post the new results in a new
cell. In other words, in cell A1 I have 123abc456. In B1, I tried to put
rtrim(A1,3) so I could produce 123abc.

I remember doing this in earlier versions of Excel. How can I do it in 2002?

bigwheel

"Pam" wrote in message
...
3 characters off the right side of a string and post the new results in a

new
cell. In other words, in cell A1 I have 123abc456. In B1, I tried to put
rtrim(A1,3) so I could produce 123abc.

I remember doing this in earlier versions of Excel. How can I do it in

2002?

TRIM removes all spaces from text except for single spaces between words.
LEFT(A1,6) will achieve your desired result.



Bernie Deitrick

Pam,

If your string length can vary then a more general solution is

=LEFT(A1,LEN(A1)-3)

HTH,
Bernie
MS Excel MVP

"Pam" wrote in message
...
3 characters off the right side of a string and post the new results in a
new
cell. In other words, in cell A1 I have 123abc456. In B1, I tried to put
rtrim(A1,3) so I could produce 123abc.

I remember doing this in earlier versions of Excel. How can I do it in
2002?




Gord Dibben

Pam

LTRIM and RTRIM are functions used in VBA, not a worksheet function. They(or
TRIM) are not the Function you want.

See other answers to your post.

Gord Dibben Excel MVP

On Tue, 30 Nov 2004 14:11:03 -0800, Pam wrote:

3 characters off the right side of a string and post the new results in a new
cell. In other words, in cell A1 I have 123abc456. In B1, I tried to put
rtrim(A1,3) so I could produce 123abc.

I remember doing this in earlier versions of Excel. How can I do it in 2002?




All times are GMT +1. The time now is 05:17 PM.

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