Combining Data from Multiple Rows

Dratchsky

New Member
Joined
Apr 24, 2021
Messages
10
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. Web
Good Morning,

I am looking for a solution to quickly help fill rows based on their shared Value in Column D

I have several group id (Column D) that I need to have go from this

Book7
ABCDEFGHIJKLMNOPQRSTUVWX
1id_numlast_namefirst_nameGroupIDmobile_phoneemail_addressRoom 1 IDRoom 1 LRoom 1 FGroupIDRoom 1 PhoneRoom 1 EmailRoom 2 ID NumberRoom 2 LRoom 2 FGroupIDRoom 2 PhoneRoom 2 EmailRoom 3 IDRoom 3 LRoom 3 FGroupIDRoom 3 PhoneRoom 3 Email
2519254Last1First1GH106(1) 234-5678Last1.First1@test.com
3503820Last2First2GH106(1) 234-5678Last2.First2@test.com
4503854Last3First3GH106(1) 234-5678Last3.First3@test.com
5510131Last4First4GH108(1) 234-5678Last4.First4@test.com
6481242Last5First5GH118(1) 234-5678Last5.First5@test.com
7474673Last6First6GH118(1) 234-5678Last6.First6@test.com
8506636Last7First7GH118(1) 234-5678Last7.First7@test.com
9507597Last8First8GH118(1) 234-5678Last8.First8@test.com
Sheet1


To This:
Book6
ABCDEFGHIJKLMNOPQRSTUVWX
1id_numlast_namefirst_nameGroupIDmobile_phoneemail_addressRoom 1 IDRoom 1 LRoom 1 FGroupIDRoom 1 PhoneRoom 1 EmailRoom 2 ID NumberRoom 2 LRoom 2 FGroupIDRoom 2 PhoneRoom 2 EmailRoom 3 IDRoom 3 LRoom 3 FGroupIDRoom 3 PhoneRoom 3 Email
2519254Last1First1GH106(1) 234-5678Last1.First1@test.com503820Last2First2GH106(1) 234-5678Last2.First2@test.com503854Last3First3GH106(1) 234-5678Last3.First3@test.com
3503820Last2First2GH106(1) 234-5678Last2.First2@test.com519254Last1First1GH106(1) 234-5678Last1.First1@test.com503854Last3First3GH106(1) 234-5678Last3.First3@test.com
4503854Last3First3GH106(1) 234-5678Last3.First3@test.com519254Last1First1GH106(1) 234-5678Last1.First1@test.com503820Last2First2GH106(1) 234-5678Last2.First2@test.com
5510131Last4First4GH108(1) 234-5678Last4.First4@test.com
6481242Last5First5GH118(1) 234-5678Last5.First5@test.com474673Last6First6GH118(1) 234-5678Last6.First6@test.com506636Last7First7GH118(1) 234-5678Last7.First7@test.com507597Last8First8GH118(1) 234-5678Last8.First8@test.com
7474673Last6First6GH118(1) 234-5678Last6.First6@test.com481242Last5First5GH118(1) 234-5678Last5.First5@test.com506636Last7First7GH118(1) 234-5678Last7.First7@test.com507597Last8First8GH118(1) 234-5678Last8.First8@test.com
8506636Last7First7GH118(1) 234-5678Last7.First7@test.com481242Last5First5GH118(1) 234-5678Last5.First5@test.com474673Last6First6GH118(1) 234-5678Last6.First6@test.com507597Last8First8GH118(1) 234-5678Last8.First8@test.com
9507597Last8First8GH118(1) 234-5678Last8.First8@test.com481242Last5First5GH118(1) 234-5678Last5.First5@test.com474673Last6First6GH118(1) 234-5678Last6.First6@test.com506636Last7First7GH118(1) 234-5678Last7.First7@test.com
Sheet1
 
You could upload a copy of your file with the macro to
But the macro does not come in the file.


If I put the macro and run it, this is the result:
Copy of Template 2.xlsm
ABCDEFGHIJKLMNOPQRSTUVWX
1id_numlast_namefirst_nameGroupIDmobile_phoneemail_addressRoom 1 IDRoom 1 LRoom 1 FGroupIDRoom 1 PhoneRoom 1 EmailRoom 2 ID NumberRoom 2 LRoom 2 FGroupIDRoom 2 PhoneRoom 2 EmailRoom 3 IDRoom 3 LRoom 3 FGroupIDRoom 3 PhoneRoom 3 Email
2519254Last1First1GH106(1) 234-5678Last1.First1@test.com503820Last2First2GH106(1) 234-5678Last2.First2@test.com503854Last3First3GH106(1) 234-5678Last3.First3@test.com
3503820Last2First2GH106(1) 234-5678Last2.First2@test.com519254Last1First1GH106(1) 234-5678Last1.First1@test.com503854Last3First3GH106(1) 234-5678Last3.First3@test.com
4503854Last3First3GH106(1) 234-5678Last3.First3@test.com519254Last1First1GH106(1) 234-5678Last1.First1@test.com503820Last2First2GH106(1) 234-5678Last2.First2@test.com
5510131Last4First4GH108(1) 234-5678Last4.First4@test.com
6481242Last5First5GH118(1) 234-5678Last5.First5@test.com474673Last6First6GH118(1) 234-5678Last6.First6@test.com506636Last7First7GH118(1) 234-5678Last7.First7@test.com507597Last8First8GH118(1) 234-5678Last8.First8@test.com
7474673Last6First6GH118(1) 234-5678Last6.First6@test.com481242Last5First5GH118(1) 234-5678Last5.First5@test.com506636Last7First7GH118(1) 234-5678Last7.First7@test.com507597Last8First8GH118(1) 234-5678Last8.First8@test.com
8506636Last7First7GH118(1) 234-5678Last7.First7@test.com481242Last5First5GH118(1) 234-5678Last5.First5@test.com474673Last6First6GH118(1) 234-5678Last6.First6@test.com507597Last8First8GH118(1) 234-5678Last8.First8@test.com
9507597Last8First8GH118(1) 234-5678Last8.First8@test.com481242Last5First5GH118(1) 234-5678Last5.First5@test.com474673Last6First6GH118(1) 234-5678Last6.First6@test.com506636Last7First7GH118(1) 234-5678Last7.First7@test.com
Sheet1


_________________________
HOW TO INSTALL MACROs
------------------------------------
If you are new to macros, they are easy to install and use. To install it, simply press ALT+F11 to go into the VB editor and, once there, click Insert/Module on its menu bar, then copy/paste the above code into the code window that just opened up. That's it.... you are done. To use the macro, go back to the worksheet with your data on it and press ALT+F8, select the macro name (Combining_Data) from the list that appears and click the Run button. The macro will execute and perform the action(s) you asked for. If you will need to do this again in this same workbook, and if you are using XL2007 or above, make sure you save your file as an "Excel Macro-Enabled Workbook (*.xlsm) and answer the "do you want to enable macros" question as "Yes" or "OK" (depending on the button label for your version of Excel) the next time you open your workbook.

_________________________

One more question, in which version of excel are you trying to run the macro?
 
Upvote 0

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,215,461
Messages
6,124,955
Members
449,199
Latest member
Riley Johnson

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