Seperating text from one cell into multiple columns

tandkb

Board Regular
Joined
Dec 29, 2010
Messages
51
Office Version
  1. 365
Platform
  1. Windows
Hi, I am trying to seperate text that is all in one cell into multiple columns. See screenshot below. Name, Business Number, Address and Hours into seperate columns. TIA!

1650414300849.png
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Please upload same data using XL2BB. Cannot manipulate data in a picture.
 
Upvote 0
You've already tried excel Text To Columns functionality

1650419369815.png
 
Upvote 0
ATM List 4.19.21.xlsx
A
5Express Mart & Tobacco Business phone:Show number →252-315-4729IMPORTANT! Address:1327 Ward BlvdWilson, NC 27893USA Open hours:Sun-Sat: 7:00 am – 11:00 pm
6Cenex Gas & Store Business phone:Show number →+13202319708IMPORTANT! Address:6647 Highway 71 NEWillmar, MN 56201USA Open hours:Mon-Sun: 6:00 am – 10:00 pm
7Everyday Conoco Business phone:Show number →303-651-3694IMPORTANT! Address:900 Ken Pratt BlvdLongmont, CO 80501USA Open hours:Sun-Sat: 6:00 am – 10:00 pm
8Fast Stop Food Store Business phone:Show number →916-666-5613IMPORTANT! Address:750 46th StSacramento, CA 95819USA Open hours:Sun-Sat: 7:00 am – 12:00 am
9Covington Mart Business phone:Show number →678-949-9860IMPORTANT! Address:3445 Covington DrDecauter, GA 30032USA Open hours:Mon-Sun: 9:00 am “ 10:00 pm
10Nicky D"s Burgerz Business phone:Show number →8109375446IMPORTANT! Address:1209 Military StPort Huron, MI 48060USA Open hours:Mon-Sun: 7:00 am – 10:00 pm
Sheet4
 
Upvote 0
Review this:

Check columns B onwards:

varios 19abr2022.xlsm
ABCDE
1Express Mart & Tobacco Business phone:Show number →252-315-4729IMPORTANT! Address:1327 Ward BlvdWilson, NC 27893USA Open hours:Sun-Sat: 7:00 am – 11:00 pm Express Mart & TobaccoBusiness phone:Show number →252-315-4729IMPORTANT!Address:1327 Ward BlvdWilson, NC 27893USAOpen hours:Sun-Sat: 7:00 am – 11:00 pm
2Cenex Gas & Store Business phone:Show number →+13202319708IMPORTANT! Address:6647 Highway 71 NEWillmar, MN 56201USA Open hours:Mon-Sun: 6:00 am – 10:00 pm Cenex Gas & StoreBusiness phone:Show number →+13202319708IMPORTANT!Address:6647 Highway 71 NEWillmar, MN 56201USAOpen hours:Mon-Sun: 6:00 am – 10:00 pm
3Everyday Conoco Business phone:Show number →303-651-3694IMPORTANT! Address:900 Ken Pratt BlvdLongmont, CO 80501USA Open hours:Sun-Sat: 6:00 am – 10:00 pm Everyday ConocoBusiness phone:Show number →303-651-3694IMPORTANT!Address:900 Ken Pratt BlvdLongmont, CO 80501USAOpen hours:Sun-Sat: 6:00 am – 10:00 pm
4Fast Stop Food Store Business phone:Show number →916-666-5613IMPORTANT! Address:750 46th StSacramento, CA 95819USA Open hours:Sun-Sat: 7:00 am – 12:00 am Fast Stop Food StoreBusiness phone:Show number →916-666-5613IMPORTANT!Address:750 46th StSacramento, CA 95819USAOpen hours:Sun-Sat: 7:00 am – 12:00 am
5Covington Mart Business phone:Show number →678-949-9860IMPORTANT! Address:3445 Covington DrDecauter, GA 30032USA Open hours:Mon-Sun: 9:00 am “ 10:00 pm Covington MartBusiness phone:Show number →678-949-9860IMPORTANT!Address:3445 Covington DrDecauter, GA 30032USAOpen hours:Mon-Sun: 9:00 am “ 10:00 pm
6Nicky D"s Burgerz Business phone:Show number →8109375446IMPORTANT! Address:1209 Military StPort Huron, MI 48060USA Open hours:Mon-Sun: 7:00 am – 10:00 pm Nicky D"s BurgerzBusiness phone:Show number →8109375446IMPORTANT!Address:1209 Military StPort Huron, MI 48060USAOpen hours:Mon-Sun: 7:00 am – 10:00 pm
Hoja5
 
Upvote 0
Review this:

Check columns B onwards:

varios 19abr2022.xlsm
ABCDE
1Express Mart & Tobacco Business phone:Show number →252-315-4729IMPORTANT! Address:1327 Ward BlvdWilson, NC 27893USA Open hours:Sun-Sat: 7:00 am – 11:00 pm Express Mart & TobaccoBusiness phone:Show number →252-315-4729IMPORTANT!Address:1327 Ward BlvdWilson, NC 27893USAOpen hours:Sun-Sat: 7:00 am – 11:00 pm
2Cenex Gas & Store Business phone:Show number →+13202319708IMPORTANT! Address:6647 Highway 71 NEWillmar, MN 56201USA Open hours:Mon-Sun: 6:00 am – 10:00 pm Cenex Gas & StoreBusiness phone:Show number →+13202319708IMPORTANT!Address:6647 Highway 71 NEWillmar, MN 56201USAOpen hours:Mon-Sun: 6:00 am – 10:00 pm
3Everyday Conoco Business phone:Show number →303-651-3694IMPORTANT! Address:900 Ken Pratt BlvdLongmont, CO 80501USA Open hours:Sun-Sat: 6:00 am – 10:00 pm Everyday ConocoBusiness phone:Show number →303-651-3694IMPORTANT!Address:900 Ken Pratt BlvdLongmont, CO 80501USAOpen hours:Sun-Sat: 6:00 am – 10:00 pm
4Fast Stop Food Store Business phone:Show number →916-666-5613IMPORTANT! Address:750 46th StSacramento, CA 95819USA Open hours:Sun-Sat: 7:00 am – 12:00 am Fast Stop Food StoreBusiness phone:Show number →916-666-5613IMPORTANT!Address:750 46th StSacramento, CA 95819USAOpen hours:Sun-Sat: 7:00 am – 12:00 am
5Covington Mart Business phone:Show number →678-949-9860IMPORTANT! Address:3445 Covington DrDecauter, GA 30032USA Open hours:Mon-Sun: 9:00 am “ 10:00 pm Covington MartBusiness phone:Show number →678-949-9860IMPORTANT!Address:3445 Covington DrDecauter, GA 30032USAOpen hours:Mon-Sun: 9:00 am “ 10:00 pm
6Nicky D"s Burgerz Business phone:Show number →8109375446IMPORTANT! Address:1209 Military StPort Huron, MI 48060USA Open hours:Mon-Sun: 7:00 am – 10:00 pm Nicky D"s BurgerzBusiness phone:Show number →8109375446IMPORTANT!Address:1209 Military StPort Huron, MI 48060USAOpen hours:Mon-Sun: 7:00 am – 10:00 pm
Hoja5
Thanks that is exactly what I am looking for but still dont know how to do it. I am not familiar with the XLBB 2.0 and how it works exactly.
 
Upvote 0
forget the XL2BB tool, it was just my example.

You should read what I put you in the link

in this part:

How to use “Fixed Width” Functionality

- Select the cell range (A5:A10). And open the “Convert Text to Column Wizard”
- In the first step of this wizard, select the radio button “Fixed Width”
- Now click on the “Finish” button.
 
Upvote 0
Assuming that there are more than the 6 rows of data that we have seen, it may be possible that Text to Columns - Fixed Width will not work for you. That will depend on the lengths of the various texts and the number of spaces between them.
Even if TTC- FW does "work" for you, it will leave all the data with multiple spaces before/after the remaining text values. That would be no good if you are using the resulting values to do look-ups or are printing labels from them etc. In that case you may then need to use a formula or macro to "clean up" those extra space characters.

Alternatively you could try this macro (with a copy of your data as it over-writes the original data) which should both split the text and remove the leading/trailing spaces
This particular code assumes there are no semi-colons in the existing data.

VBA Code:
Sub Split_Text()
  Dim RX As Object
  Dim a As Variant
  Dim i As Long
 
  Set RX = CreateObject("VBScript.RegExp")
  RX.Global = True
  RX.Pattern = "(\s{2,})(Business|Address|Open|$)"
  With Range("A5", Range("A" & Rows.Count).End(xlUp))
    a = .Value
    For i = 1 To UBound(a)
      a(i, 1) = RX.Replace(a(i, 1), ";$2")
    Next i
    Application.ScreenUpdating = False
    .Value = a
    .TextToColumns DataType:=xlDelimited, Tab:=False, Semicolon:=True, Comma:=False, Space:=False, Other:=False
    .Resize(, 4).Columns.AutoFit
    Application.ScreenUpdating = True
  End With
End Sub

Using your sample data from post #4, this is my result after running the above code.

tandkb.xlsm
ABCD
5Express Mart & TobaccoBusiness phone:Show number →252-315-4729IMPORTANT!Address:1327 Ward BlvdWilson, NC 27893USAOpen hours:Sun-Sat: 7:00 am – 11:00 pm
6Cenex Gas & StoreBusiness phone:Show number →+13202319708IMPORTANT!Address:6647 Highway 71 NEWillmar, MN 56201USAOpen hours:Mon-Sun: 6:00 am – 10:00 pm
7Everyday ConocoBusiness phone:Show number →303-651-3694IMPORTANT!Address:900 Ken Pratt BlvdLongmont, CO 80501USAOpen hours:Sun-Sat: 6:00 am – 10:00 pm
8Fast Stop Food StoreBusiness phone:Show number →916-666-5613IMPORTANT!Address:750 46th StSacramento, CA 95819USAOpen hours:Sun-Sat: 7:00 am – 12:00 am
9Covington MartBusiness phone:Show number →678-949-9860IMPORTANT!Address:3445 Covington DrDecauter, GA 30032USAOpen hours:Mon-Sun: 9:00 am “ 10:00 pm
10Nicky D"s BurgerzBusiness phone:Show number →8109375446IMPORTANT!Address:1209 Military StPort Huron, MI 48060USAOpen hours:Mon-Sun: 7:00 am – 10:00 pm
Sheet3
 
Upvote 0

Forum statistics

Threads
1,214,648
Messages
6,120,725
Members
448,987
Latest member
marion_davis

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