Seperating out lists

BenjaminDubai

New Member
Joined
May 7, 2007
Messages
42
I have this

Cell 1 -/- Cell 2

1 -/- R1, R2, R3
2 -/- R1, R2, R3, R4, R5
3 -/-
4 -/- R1
5 -/- R1, R2, R3

and I would like to get to this

Cell 1 -/- Cell 2

1 -/- R1
-/- R2
-/- R3
2 -/- R1
-/- R2
-/- R3
-/- R4
-/- R5
3 -/-
4 -/- R1
5 -/- R1
-/- R2
-/- R3

WITHOUT doing it manually!

Any ideas?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi
Assuming your data is in sheet1, paste the following codes in the macro window ( Alt F8)
Code:
Sub elongate()
c = 1
x = Cells(Rows.Count, 1).End(xlUp).Row
For a = 1 To x
y = Cells(a, Columns.Count).End(xlToLeft).Column
For b = 3 To y
Worksheets("sheet2").Cells(c, 1) = Cells(a, 1) & " " & Cells(a, 2) & " " & Cells(a, b)
c = c + 1
Next b
Next a
End Sub
run the macro. It will paste the data in sheet2 col A
Ravi
 
Upvote 0
Errrm

Thank you but I can't get that working. I have the Data in A1, Sheet one.
Nothing appears in sheet 2.

Sorry you may have to assist further!

It looks very neat and nice tho...
 
Upvote 0

Forum statistics

Threads
1,214,897
Messages
6,122,148
Members
449,066
Latest member
Andyg666

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