Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello all,
I have some cells that look like this 1 One 02 Two 003 Three 4 Four 000005 Five and I am looking for a way to cut and paste the number into a new column. I am guessing I should search and select anything from the beginning of the line to the first space. I could then cut this value and place it elsewhere. I am not certain how to perform this kind of search in Excel though? Could someone give me an example of how to search from the beginning of a cell to the first space? TIA, Lance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Apr 27, 12:15*pm, Lance wrote:
I have some cells that look like this 1 One 02 Two 003 Three 4 Four 000005 Five and I am looking for a way to cut and paste the number into a new column. *I am guessing I should search and select anything from the beginning of the line to the first space. *I could then cut this value and place it elsewhere. You could do that. See below. But perhaps the easiest way is to use the Text To Column feature. In XL2003, click on Data Text To Column, select an appropriate delimiter, click Next to move along, and in the last menu, select Skip for the second column and select where you would like the result. If you want to retain the leading zeros, either mark the column as Text before clicking Finish, or afterwards choose an appropriate Custom format, e.g. 000000. As for a function, you might use the following paradigm: =LEFT(A1,FIND(" ",A1)-1) or =--LEFT(A1,FIND(" ",A1)-1) The first form produces text, which preserves leading zeros. The second form produces numeric results, which would require a Custom format to display leading zeros. Caveat: The blanks you see might be non-breaking spaces (HTML ) instead of normal spaces. In that case, replace " " with CHAR(160). |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Apr 27, 2:15*pm, Lance wrote:
Hello all, I have some cells that look like this 1 One 02 Two 003 Three 4 Four 000005 Five and I am looking for a way to cut and paste the number into a new column. *I am guessing I should search and select anything from the beginning of the line to the first space. *I could then cut this value and place it elsewhere. I am not certain how to perform this kind of search in Excel though? Could someone give me an example of how to search from the beginning of a cell to the first space? TIA, Lance Lots of ways: datatext to columns formula using FIND or SEARCH macro using INSTR |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Apr 27, 12:31*pm, joeu2004 wrote:
Caveat: *The blanks you see might be non-breaking spaces (HTML *) Interesting: my broswer (at least) changed the text I wrote after "HTML". I wrote ampersand nbsp semicolon, the HTML element representing a non-breaking space. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
on 4/27/2011, Lance supposed :
Hello all, I have some cells that look like this 1 One 02 Two 003 Three 4 Four 000005 Five and I am looking for a way to cut and paste the number into a new column. I am guessing I should search and select anything from the beginning of the line to the first space. I could then cut this value and place it elsewhere. I am not certain how to perform this kind of search in Excel though? Could someone give me an example of how to search from the beginning of a cell to the first space? TIA, Lance Enter the following formula into the cell[s] where you want the results. =LEFT(A1,FIND(" ",A1)-1) Be sure to change the ref to 'A1' to match the 1st source cell, then copy down (or to) other cells as desired. -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
=LEFT(A1,FIND(" ",A1)-1) works like a charm. Thanks very much.
Lance On 4/27/2011 2:37 PM, GS wrote: on 4/27/2011, Lance supposed : Hello all, I have some cells that look like this 1 One 02 Two 003 Three 4 Four 000005 Five and I am looking for a way to cut and paste the number into a new column. I am guessing I should search and select anything from the beginning of the line to the first space. I could then cut this value and place it elsewhere. I am not certain how to perform this kind of search in Excel though? Could someone give me an example of how to search from the beginning of a cell to the first space? TIA, Lance Enter the following formula into the cell[s] where you want the results. =LEFT(A1,FIND(" ",A1)-1) Be sure to change the ref to 'A1' to match the 1st source cell, then copy down (or to) other cells as desired. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I delete a space in the beginning of a cell... | Excel Discussion (Misc queries) | |||
enter does 1 line space- scanner does 2 line space need 1 line | New Users to Excel | |||
Delete space at beginning | Excel Discussion (Misc queries) | |||
Remove space at beginning of each name | Excel Discussion (Misc queries) | |||
eliminate space at beginning of line | Excel Worksheet Functions |