Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How do I find all cells (with text in it) that ends with a space ie.
"This is some text " which I either want to highlight or automatically fix to: "This is some text" I'm using Excel 97. I have tried to turn on showing special character like you can in Word (where a space appears as a dot), but couldn't find that command. The Find command also doesn't help. Many thanks, Alain |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Wed, 3 Feb 2010 12:02:17 -0000, "Alain Dekker"
wrote: How do I find all cells (with text in it) that ends with a space ie. "This is some text " which I either want to highlight or automatically fix to: "This is some text" I'm using Excel 97. I have tried to turn on showing special character like you can in Word (where a space appears as a dot), but couldn't find that command. The Find command also doesn't help. Many thanks, Alain The trailing space may be the normal <space character, but, especially if the source of this data was an html document (or downloaded from the web), might be a <nbsp (char(160). To determine if the last character is a <space, something like: =ISNUMBER(FIND(" ",A1,LEN(A1))) To determine if the last character is a <nbsp, something like: =ISNUMBER(FIND(CHAR(160),A1,LEN(A1))) To remove the last character: =IF(ISNUMBER(FIND(" ",A1,LEN(A1))),LEFT(A1,LEN(A1)-1),A1) or =IF(ISNUMBER(FIND(CHAR(160),A1,LEN(A1))),LEFT(A1,L EN(A1)-1),A1) --ron |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
in an adjacent column do =trim(a1) being a1 the cell where you have the text "Alain Dekker" wrote: How do I find all cells (with text in it) that ends with a space ie. "This is some text " which I either want to highlight or automatically fix to: "This is some text" I'm using Excel 97. I have tried to turn on showing special character like you can in Word (where a space appears as a dot), but couldn't find that command. The Find command also doesn't help. Many thanks, Alain . |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this small macro:
Sub blankremover() For Each r In ActiveSheet.UsedRange v = r.Value If Right(v, 1) = " " Then r.Value = Left(v, Len(v) - 1) End If Next End Sub -- Gary''s Student - gsnu201001 "Alain Dekker" wrote: How do I find all cells (with text in it) that ends with a space ie. "This is some text " which I either want to highlight or automatically fix to: "This is some text" I'm using Excel 97. I have tried to turn on showing special character like you can in Word (where a space appears as a dot), but couldn't find that command. The Find command also doesn't help. Many thanks, Alain . |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks for all those answers!
"Gary''s Student" wrote in message ... Try this small macro: Sub blankremover() For Each r In ActiveSheet.UsedRange v = r.Value If Right(v, 1) = " " Then r.Value = Left(v, Len(v) - 1) End If Next End Sub -- Gary''s Student - gsnu201001 "Alain Dekker" wrote: How do I find all cells (with text in it) that ends with a space ie. "This is some text " which I either want to highlight or automatically fix to: "This is some text" I'm using Excel 97. I have tried to turn on showing special character like you can in Word (where a space appears as a dot), but couldn't find that command. The Find command also doesn't help. Many thanks, Alain . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find position number of third space | Excel Worksheet Functions | |||
Find last space | Excel Worksheet Functions | |||
Using FIND function to locate space between first and last name | Excel Worksheet Functions | |||
Can I find and replace "white space" in a cell in Excel? | Excel Worksheet Functions | |||
Find last space from the right of text | Excel Discussion (Misc queries) |