Word Search VBA

canthony24

Board Regular
Joined
Mar 24, 2016
Messages
70
I have a pivot table that looks at supplier sales sorted descending on percent to total. Since suppliers have multiple vendor names, a particular supplier might show up as a different vendor in the pivot table. As you can see from a subset of the pivot below, Coca Cola shows up twice on the data, same supplier but a different vendor in a sense. I would like some type of code to search for similar vendor names and add up the sales to only show one. Coca Cola is just one example. Pepsi might be Pepsico, Pepsi Beverages.

Any ideas?

COCA COLA5,409,34338.02%
PEPSICO2,614,33418.37%
COCA COLA BOTTLERS SALES&SVC1,787,87512.57%
NATIONAL BEVERAGE CORP931,2196.55%
CADBURY SCHWEPPES863,8706.07%
COTT BEVERAGES INC828,3135.82%

<tbody>
</tbody>
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Do you have any control over the input of the data? How consistent are the vendor names between macro runs? Are there any columns in the data table that might link those companies together like NYSE symbols? The ideal solution would be to control input of the data by use of a combobox or the like, but if you're pulling this from external sources, you may not have that option.

You could just do the leg work to find all or most of the multiples and have the VBA loop through the data and adjust names accordingly, but new multiples would require further adjustments of the VBA.

A possibly inefficient and error prone way could be to load all vendor names to an array, loop through that array and filter the table on each name in the array, changing the names that match the filter.
 
Upvote 0

Similar threads

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

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