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

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

ravishankar

Well-known Member
Joined
Feb 23, 2006
Messages
3,566
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
 

BenjaminDubai

New Member
Joined
May 7, 2007
Messages
42
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...
 

Forum statistics

Threads
1,181,730
Messages
5,931,701
Members
436,799
Latest member
BasOo

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
Top