Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Trim Leading Spaces
How do I trim the just the leading and trailing spaces in a cell?
For example " Project - 1234 " becomes "Project - 1234" Thank you for you help. Steven |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Trim Leading Spaces
All in one column?
Select that column Data|Text to columns Fixed width remove any lines that excel guessed Finish up. Steven wrote: How do I trim the just the leading and trailing spaces in a cell? For example " Project - 1234 " becomes "Project - 1234" Thank you for you help. Steven -- Dave Peterson |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Trim Leading Spaces
=TRIM(A1) etc.
Dave -- A hint to posters: Specific, detailed questions are more likely to be answered than questions that provide no detail about your problem. "Steven" wrote: How do I trim the just the leading and trailing spaces in a cell? For example " Project - 1234 " becomes "Project - 1234" Thank you for you help. Steven |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Trim Leading Spaces
Using trim leaves a space between the quotes and the first and last letter so
a bit more complicated but try =CONCATENATE("""",TRIM(MID(A15,2,LEN(A15)-2)),"""") where your string is in A15 "Steven" wrote: How do I trim the just the leading and trailing spaces in a cell? For example " Project - 1234 " becomes "Project - 1234" Thank you for you help. Steven |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Trim Leading Spaces
There are not actually quotes in the string. I just have them to show there
are spaces in front and back. Also, the number of spaces can vary. The first record may have 3 spaces in front and the second 5 and so on..... ' This is record one ' ' This is record two ' 'This is record three ' There are not really ' in the cell. I just included them to show all the blank spaces. How using a formula would you take the leading and trailing spaces away? Thank you, Steven |
#6
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Trim Leading Spaces
I forgot to mention:
If I just put an example in excel with spaces then the text then spaces and test with Trim(CellAddress) then it will trim properly. This was something taken off the internet. I have see in other posts where you have to test the characters but I have not been able to make those work. It is the leading spaces that seem to cause the problem. Steven |
#7
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Trim Leading Spaces
They probably aren't spaces but some other character which doesn't display.
Try copying one of the "leading spaces" and then use Edit Replace on your range of cells replacing the offending character with nothing [just paste your charcater into the "find" box] "Steven" wrote: I forgot to mention: If I just put an example in excel with spaces then the text then spaces and test with Trim(CellAddress) then it will trim properly. This was something taken off the internet. I have see in other posts where you have to test the characters but I have not been able to make those work. It is the leading spaces that seem to cause the problem. Steven |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
trim leading spaces | Excel Discussion (Misc queries) | |||
How to trim spaces from entered text in cell using exisiting functions? | Excel Worksheet Functions | |||
How do I add leading spaces to a value? | Excel Worksheet Functions | |||
Strip leading spaces from cell | Excel Worksheet Functions | |||
Remove Leading Spaces | Excel Discussion (Misc queries) |