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

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,213,484
Messages
6,113,927
Members
448,533
Latest member
thietbibeboiwasaco

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