Make comma delimited list from column data using search criteria

rarexcel

New Member
Joined
Oct 19, 2010
Messages
9
If I have the following data in two columns, I need VBA code that creates a new table that finds the data associated with A,B, or C and then lists it as comma delimited text --

It's kind of like a sumif in Excel except that instead of adding numerical values, I need to create a list of text.

Column One
A
A
A
B
B
C

Column Two
Text 1
Text 2
Text 3
Text 4
Text 5
Text 6

The result would look as follows:

A Text1, Text2, Text3
B Text4, Text5
C Text6

Any help you can give would be appreciated. :rolleyes:
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
If the data is sorted as implied do you really need VBA ?

A basic helper route might suffice...

Excel Workbook
ABCDE
1HdrHdrHdrResultsText
2AText 1,Text 1AText 1,Text 2,Text 3
3AText 2,Text 1,Text 2BText 4,Text 5
4AText 3,Text 1,Text 2,Text 3CText 6
5BText 4,Text 4
6BText 5,Text 4,Text 5
7CText 6,Text 6
Sheet2
 
Upvote 0
Thank you so much :biggrin:

This is perfect AND I don't have to code in VBA.

I can't believe I've never encountered the REPT function before...
 
Upvote 0

Forum statistics

Threads
1,214,658
Messages
6,120,778
Members
448,992
Latest member
prabhuk279

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