Segregate Table data in into columns lists - VBA

Vbalearner85

Board Regular
Joined
Jun 9, 2019
Messages
139
Office Version
  1. 2016
Platform
  1. Windows
Need VBA help

For below data set in sheet "Data"
Rollup Country(Column A) Country(Column B) Brand(Column C)
Bangladesh Bangladesh Coke
Bangladesh Bangladesh Pepsi
Other India Salt
Other India Spices
Other Pakistan Salt
Other Pakistan Spices
Iran Iran Food
Iran Iran Travel
...and so on....

VBA should give segregated lists in sheet "Lists" as below
1.If country and Rollup country is same..it should give country in Cell A2 and the lists concatenate of Country& Brand below it
2. If Rollup country is "Other" then it should list all concatenates as in column "B" starting with others in cell "B2"

Column A Column B Column C
Bangladesh Others Iran (Alphabetically...>>>>>)
BangladeshCoke IndiaSalt Food
BangladeshPepsi IndiaSpices Travel
PakistanSalt
PakistanSpices and so on....
 
Last edited:

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,224,818
Messages
6,181,152
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