Filter multiple pivot tables 2007

jtodd

Board Regular
Joined
Aug 4, 2014
Messages
194
HI All
I have 4 pivot tables based on the same data set but give different data by week number.
I would like to change the week number in the first pivot ,say 39, and all the other pivots on my sheet would change to 39 as well

I cannot use slicers as the end user only uses 2007

is this possible ? and if so how?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
You can use a macro.

Put in cell C1 the week number.

VBA Code:
Sub UpdatePivottables()
    Dim sh As Worksheet
    Dim pt As PivotTable
    Dim ptField As PivotField
    Dim ptItem As PivotItem
    Dim pc As PivotCache
    For Each sh In ThisWorkbook.Worksheets
        For Each pt In sh.PivotTables
            pt.PivotFields("Weeknumber").ClearAllFilters
            For Each ptItem In pt.PivotFields("Weeknumber").PivotItems
                If ptItem.Name <> ActiveSheet.Range("C1").Value Then
                    ptItem.Visible = False
                End If
            Next ptItem
        Next pt
    Next sh
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,738
Members
448,988
Latest member
BB_Unlv

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