Problem with choosing multiple item under selected field in pivot table (using VBA)

Yozie

New Member
Joined
Jun 30, 2018
Messages
1
I have problem to code macro to select multiple item under a particular field in pivot table.
The criteria for the item being used is coming from a table in another sheet (brand)

Brand
Brand Cde
AAA
BBB
CCC
BIO
BCL

PivotTableSheet (pick some sample only):
Values
CATEGORYBRANDItem Code Jun-17 Jul-17 Aug-17 Sep-17
PREMIUMBCL010120001000 38 (11) (22) 15
PREMIUMBCL010120002000 85 33 (6) 9
PREMIUMBCL010120003000 70 14 (8) 12
PREMIUMBCL010120004000 116 41 7 35
PREMIUMBCL010120005000 87 9 (12) 6
PREMIUMBCL010120006000 89 41 14 22
PREMIUMBCL010120007000 49 27 (3) 23
PREMIUMBCL010120008000 9 6 5 11
PREMIUMBCL010120009000 103 41 3 30
PREMIUMBCL010120010000 59 1 (17) 6
PREMIUMBCL010120011000 54 35 (4) 15
PREMIUMBCL010120012000 50 (3) 3 (2)
PREMIUMBCL010120013000 77 28 2 10
PREMIUMBCL010120014000 45 (7) (4) 1

I have tried using looping mechanism (for i = 0 to ...) to pick all the brand.
But it does not work.
The brand name in the table can change dynamically (as per user needs).
Any idea how to solve this?
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,141,715
Messages
5,708,030
Members
421,540
Latest member
quocbinh

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
Top