VBA to Concatenate one column data in excel and dedupe additional line items

Status
Not open for further replies.

Beth0331

New Member
Joined
Jun 13, 2018
Messages
7
Hello, Apologies if this is already on here - I did a search but was not successful in finding anything that is exactly what I'm looking for (and my VBA knowledge is limited...)

I am looking to take data I have in an excel spreadsheet and concatenate one columns data for a referenced "tag" (User ID below) in a another column. For example below, for all line items with the user ID jdoe3 i would like to combine the colors into one line and discard the remaining lines. Are you able to help me with the VBA code I would need to do this?

Currently it looks like this:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]User ID[/TD]
[TD]Colors[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]jdoe3[/TD]
[TD]blue[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]jdoe3[/TD]
[TD]yellow[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]jdoe3[/TD]
[TD]green[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]jdoe3[/TD]
[TD]orange[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]jdoe3[/TD]
[TD]red[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]jdoe3[/TD]
[TD]purple[/TD]
[/TR]
[TR]
[TD]Jane Smith[/TD]
[TD]jsmith5[/TD]
[TD]green[/TD]
[/TR]
[TR]
[TD]Jane Smith[/TD]
[TD]jsmith5[/TD]
[TD]orange[/TD]
[/TR]
[TR]
[TD]Jane Smith[/TD]
[TD]jsmith5[/TD]
[TD]red[/TD]
[/TR]
[TR]
[TD]George Phillips[/TD]
[TD]gphillips[/TD]
[TD]blue[/TD]
[/TR]
[TR]
[TD]George Phillips[/TD]
[TD]gphillips[/TD]
[TD]green[/TD]
[/TR]
</tbody>[/TABLE]


I would like it to look like this:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]User ID[/TD]
[TD]Colors[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]jdoe3[/TD]
[TD]blue, yellow, green, orange, red, purple[/TD]
[/TR]
[TR]
[TD]Jane Smith[/TD]
[TD]jsmith5[/TD]
[TD]green, orange, red[/TD]
[/TR]
[TR]
[TD]George Phillips[/TD]
[TD]gphillips[/TD]
[TD]blue, green[/TD]
[/TR]
</tbody>[/TABLE]

I'm using excel 2016

Thank You!
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Duplicate https://www.mrexcel.com/forum/excel...ional-line-items-post5086520.html#post5086520

Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread.
Per forum rules, posts of a duplicate nature will be locked or deleted (rule 12 here: Forum Rules).

Note that sometimes posts from new users require Moderator approval before you can see them on the public forums. When this happens, you should see a message to that effect when you try to post it.
Please be patient and do not attempt to post the question again.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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