Clear pivot table filters

Turbo613

Board Regular
Joined
Mar 2, 2007
Messages
134
Overview
I have 7 pivot tables on one workbook in Excel2003. I have a combo box that updates all the pivot tables at the same time. The combo box references a named range via an index function. The lookup table that the index function and combo box uses is set as a named range that can expand or contract; im not sure if that is important, but here is the code I have for the named range called "Office2" =OFFSET(Pivot!$L$100,0,0,COUNT(Pivot!$L:$L),1).

Problem
Most of the time the pivots work when I use the dropdown box. but on ocassion, they don't update to the new data from the combo box. I think I need to use a feature that is available in Excel2007 called ClearAllFilters, but I don't know what that is called or how to do it in Excel2003 VBA coding and I need help.

Code
Here is the module the Combo box references:

Sub ProPivotCombo()

ActiveSheet.PivotTables("Pvt1").PivotFields("OfficeNumber").CurrentPage = Range("N98").Text

ActiveSheet.PivotTables("Pvt2").PivotFields("OfficeNumber").CurrentPage = Range("N98").Text

ActiveSheet.PivotTables("Pvt3").PivotFields("OfficeNumber").CurrentPage = Range("N98").Text

ActiveSheet.PivotTables("Pvt4").PivotFields("OfficeNumber").CurrentPage = Range("N98").Text

ActiveSheet.PivotTables("Pvt5").PivotFields("OfficeNumber").CurrentPage = Range("N98").Text

ActiveSheet.PivotTables("Pvt6").PivotFields("OfficeNumber").CurrentPage = Range("N98").Text

End Sub[/b]
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Datsmart

Well-known Member
Joined
Jun 19, 2003
Messages
7,985
This code will clear old data from all your pivot tables:
Code:
Sub Clean_Pivots()
Dim ws As Workbook
Dim pt As PivotTable
    For Each ws In Workbooks
        For Each pt In ActiveSheet.PivotTables
            pt.PivotCache.MissingItemsLimit = xlMissingItemsNone
        Next
    Next
End Sub
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,161
Messages
5,768,547
Members
425,481
Latest member
ihumanl

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