Seperate Text in Cells

maic15

Active Member
Joined
Nov 17, 2004
Messages
313
I have cells that contain the following data:

Air Filtration Management Inc 00511578
Airport Diner 00510263
Al Prueitt & Sons 00511199
Albrecht Inc 00506438
Alan S. Roseberg Assoc., Inc. 00505659
Alert-All Corporation 00501902


I need to seperate the data into two different cells. Text to columns will not work. Does anyone know another way.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi, maic

it seems to eme you want to seperate the last 8 characters.
is this correct?

kind regards,
Erik
 
Upvote 0
OK, then use "left" and "right"
just like this

TAKE CARE: the sourcedata may not have leading or ending spaces)
else apply TRIM(A5) instead of A5

kind regards,
Erik
Map1.xls
ABCD
5AirFiltrationManagementInc00511578AirFiltrationManagementInc00511578
6AirportDiner00510263AirportDiner00510263
7AlPrueitt&Sons00511199AlPrueitt&Sons00511199
8AlbrechtInc00506438AlbrechtInc00506438
9AlanS.RosebergAssoc.,Inc.00505659AlanS.RosebergAssoc.,Inc.00505659
10Alert-AllCorporation00501902Alert-AllCorporation00501902
Blad1
 
Upvote 0
If it is always that you want the right 8 characters, and the rest in two different columns, then in column B use.
=Left(A1,Len(A1)-8) for the left part.

In Column C you could use.
=Right(A1,8) for the right part.
 
Upvote 0
Or you can use code:
I prefer "-9" to get rid of the space
If you want to erase the first column then use no offset for the first line
ccc.Value =
and for the second line
ccc.Offset(0, 1)

kind regards,
Erik

Code:
Sub put_in_2_cols()
For Each ccc In Range(Range("A5"), Range("A65536").End(xlUp))
ccc.Offset(0, 1) = Left(ccc, Len(ccc) - 9)
ccc.Offset(0, 2) = Right(ccc, 8)
Next ccc
End Sub
 
Upvote 0

Forum statistics

Threads
1,203,460
Messages
6,055,556
Members
444,796
Latest member
18ecooley

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top