Macro to re-Arrange and insert data based on 2 columns values

hisham2k11

New Member
Joined
Sep 23, 2011
Messages
1
I need help in achieving the below scenario using Macro or any other alternative:
I have data in a sheet whose cloumn A contains teams in random order and ColumnB contains its members.
ColumnA CloumnB
team1 Monty1
team1 Javier
team2 Alex
team3 Manish
team1 Daniel
team2 Howdy
team1 Ballex
team1 hunter
team2 Banter
team2 Carter
team3 Lord
team4
team3 Sandy
team3 Zoro
team5 boss

I have a second sheet that contains many columns full of data of which there is one columnA called teams which contains teams.
I need the data to be inserted in sheet1 in just a single column where each Team will be followed by its members just below it.
ColumnA
team1
Monty1
Javier
Daniel
Ballex
hunter
team2
Alex
Howdy
Banter
Carter
team3
Manish
Lord
Sandy
Zoro
team4
team5
boss
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,224,606
Messages
6,179,866
Members
452,948
Latest member
UsmanAli786

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