How to link several pivot tables by a Combo box?

robertolux

New Member
Joined
Sep 20, 2012
Messages
2
Hi there,


This is my first thread. I hope I post it in the right place...


In an XLS sheet I have four pivot tables, each of them having as a report filter field "Country".

I would like to include a dropdown box (combobox) in the sheet where I can select the country. Once a country has been selected, I would like Excel to automatically update the Pivot table filter of all four pivot tables to the selected country.

Although I managed to do this by creating a combobox with a related Macro (cf. main code below) I am convinced that there is a much smarter way to achieve this. Moreover, my "solution" does not enable me to use " (All) " as selection, i.e. showing all data in the pivot table.

Here is the "magic macro":

ActiveSheet.PivotTables("PivotTable1").PivotFields("Country").CurrentPage = Range("G6").Value

Cell G6 includes the selected country (i.e. result of the combobox)

Looking forward to receiving your comments.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Thanks Andrew!

Slicers functionality seems to deliver exactly what I am looking for. Unfortunately I have to use 2007 for the time being ... waiting for our IT department to roll-out 2010 version.

Do you by any chance have a non-VBA solution for Excel 2007. In the meantime I found several VBA solutions.

Thanks again.
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,176
Members
448,554
Latest member
Gleisner2

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