Single Cell to Rows

Blessy Clara

Board Regular
Joined
Mar 28, 2010
Messages
201
Hi I have an excel sheet - the Data in the sheets are as - a single cell contains multiple lines of data - I wanna split the lines within the cell in to separate row -

Phil Ross
Mc Lean David
Ross Andrews
Matthew Anders
Sandra

21359877
25789563
4879652
2147631
24178965
email1
email2
email3
email4
email5

Requirement
Phil Ross21359877email1

<tbody>
</tbody>
Likewise each cell data split into separate columns,
Thank you - Please help
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi I have an excel sheet - the Data in the sheets are as - a single cell contains multiple lines of data - I wanna split the lines within the cell in to separate row -

Phil Ross
Mc Lean David
Ross Andrews
Matthew Anders
Sandra

21359877
25789563
4879652
2147631
24178965
email1
email2
email3
email4
email5

Requirement
Phil Ross21359877email1

<tbody>
</tbody>
Likewise each cell data split into separate columns,
Thank you - Please help
Is all of that data (5 rows and 3 columns) all in a single cell or are the columns already separate? If all in the same cell, what character or characters are separating what will end up in separate columns... spaces or tabs?
 
Upvote 0
What separates the "lines" in each cell? CHAR(10) ?

If the cells are in A1, for example, I did this in B1, C1, and D1, respectively:

B1:
Code:
=LEFT(A1,FIND(CHAR(10),A1)-1)

C1:
Code:
=MID($A1,FIND(CHAR(10),$A1,FIND(CHAR(10),$A1))+1,(FIND(CHAR(10),$A1,FIND(CHAR(10),$A1)+1))-(FIND(CHAR(10),$A1,FIND(CHAR(10),$A1))+1))

D1:
Code:
=MID($A1,FIND(CHAR(10),$A1,FIND(CHAR(10),$A1)+1)+1,LEN($A1)-FIND(CHAR(10),$A1,FIND(CHAR(10),$A1)+1)+1)
 
Upvote 0
I didn't see your drop box until after I posted. Will see about this with your data.
 
Upvote 0
Hi Rick Rothstein
Thank you for the response - No the Cols are separate -
This is how the data looks -
https://www.dropbox.com/s/0k29tjqf75foes4/EB.xlsx?dl=0
Assuming the final output will always be less than about 65000 rows of data, run this macro with your data sheet active and it will output the desired result to Sheet2 (change as needed)...
Code:
[table="width: 500"]
[tr]
	[td]Sub BlessyClara()
  Dim LastRow As Long, Col As Long, ColData As Variant
  LastRow = Cells(Rows.Count, "A").End(xlUp).Row
  For Col = 1 To 3
    ColData = Split(Join(Application.Transpose(Range(Cells(1, Col), Cells(LastRow, Col))), vbLf), vbLf)
    Sheets("[B][COLOR="#0000FF"]Sheet2[/COLOR][/B]").Cells(1, Col).Resize(UBound(ColData) + 1) = Application.Transpose(ColData)
  Next
  Sheets("[B][COLOR="#0000FF"]Sheet2[/COLOR][/B]").Columns("A:C").AutoFit
End Sub[/td]
[/tr]
[/table]
 
Last edited:
Upvote 0
Great macro, Rick.

Now, if Clara wants the names, then, I suppose that's a phone #, then the email in D, E and F columns:

D2 filled down:
Code:
=SUBSTITUTE(LEFT(A2,FIND(" ",A2)-1)&" "&RIGHT(A2,LEN(A2)-FIND("=",A2)),"""","")

E2 filled down:
Code:
=LEFT(C2,FIND("""",C2)-1)

And F2 filled down is simply =B2
 
Upvote 0
Hi Rick
:O Wow - That is amazing - Thank you Rick

Hi kweaver
Yeah Thank you very much for the Formula - Yeah it helps me further clean up the Data - That was indeed supposed to be my next step
 
Upvote 0

Forum statistics

Threads
1,214,878
Messages
6,122,062
Members
449,064
Latest member
scottdog129

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