Need help merging cels based on another cel

gyagos

New Member
Joined
Mar 27, 2018
Messages
27
Office Version
  1. 365
Platform
  1. Windows
All,
I have been trying to figure out how to do this, but i have been unsuccessful so far. I have a spreadsheet (below is just a snippet) that contains the following information:

GROUPUser
Telecom-Corp
User 1
Telecom-CorpUser 2
Telecom-CorpUser 3
Telecom-CorpUser 4
Telecom-CorpUser 5
Telecom-CorpUser 6
Data Center Platform - Windows SoftwareUser 1
CMS-CharlotteUser 1
CMS-CharlotteUser 2
CMS-CharlotteUser 3
CMS-CharlotteUser 4
Collaboration EngineeringUser 1
Collaboration EngineeringUser 2
Collaboration EngineeringUser 3
Collaboration EngineeringUser 4
Database SoftwareUser 1

<tbody>
</tbody>


What i would like to do is if the GROUP has multiple users, combine all users within the group so that the new list would be like the following:

GroupUsers
Telecom-CorpUser 1, User 2, User 3, User 4, User 5, User 6
CMS-CharlotteUser 1, User 2, User 3, User 4
Collaboration EngineeringUser 1, User 2, User 3, User 4
Data Center Platform - Windows SoftwareUser 1
Database SoftwareUser 1

<tbody>
</tbody>

Any help would be greatly appreciated
Thank you in Advance

<colgroup><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
How about
Code:
Sub gyagos()
   Dim Cl As Range
   Dim Dic As Object
   Dim Ky As Variant
   
   Set Dic = CreateObject("scripting.dictionary")
   For Each Cl In Range("A2", Range("A" & Rows.Count).End(xlUp))
      If Not Dic.Exists(Cl.Value) Then Dic.Add Cl.Value, CreateObject("scripting.dictionary")
      Dic(Cl.Value)(Cl.Offset(, 1).Value) = Empty
   Next Cl
   For Each Ky In Dic.keys
      Range("E" & Rows.Count).End(xlUp).Offset(1).Resize(, 2).Value = Array(Ky, Join(Dic(Ky).keys, ", "))
   Next Ky
End Sub
 
Upvote 0
Works perfectly
Thank you very much for the quick response & solution
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,214
Members
449,074
Latest member
cancansova

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