combo box with date that changes multiple pivot tables

sherryjoe

New Member
Joined
May 12, 2011
Messages
1
I have a combo box that is linked to a list of dates. I have numerous getpivotdata commands that are based on the date that is selected in the combo box. I have 20 or so pivot tables that I want to filter to the date selected in the combo box. Sometimes, there is no data in one of the pivot tables for that date, so I want the pivot table to select no fields and the getpivotdata to return zero, not just skip it because then it leaves the pivot table with no filters and returns the wrong number in the getpivotdata command.

CurrentDateCode is the link to the combo box, Control!J and K are my sheets and pivot tables.

For i = 5 To 30 Sheets(Range("Control!J" & i).Value).PivotTables(Range("Control!K" & i).Value).PivotFields("FILE_DATE").ClearAllFilters
Sheets(Range("Control!J" & i).Value).PivotTables(Range("Control!K" & i).Value).PivotFields("FILE_DATE").CurrentPage = Range("CurrentDateCode").Value
Next i
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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