+ Reply to Thread
Results 1 to 3 of 3

Change PivotFilter on all pivot tables in workbook based on cell reference

  1. #1
    Registered User
    Join Date
    03-28-2013
    Location
    ddddd
    MS-Off Ver
    Excel 2003
    Posts
    6

    Change PivotFilter on all pivot tables in workbook based on cell reference

    Hi all,

    I wanted to see if anyone can help with vba code on pivot tables

    I have a report Filter on my Pivot table. The macro that I have sets the Pivot filter to the date that I have entered in Cell "C3".

    Does anyone know how I can adapt the below code to update all pivot tables in my workbook without naming each individual Pivot table.


    Sub aab()

    Dim pi As PivotItem
    Worksheets("Jar").PivotTables("PivotTable38").PivotFields("Business_date").ClearAllFilters
    With Worksheets("Jar").PivotTables("PivotTable38").PivotFields("Business_date")



    For Each pi In .PivotItems
    pi.Visible = WorksheetFunction.CountIf(Worksheets("Report_Creator").Range("c3"), pi.Name) > 0
    Next pi

    End With
    End Sub




    I would be very grateful for any input.

    Thanks in advance

  2. #2
    Registered User
    Join Date
    03-28-2013
    Location
    ddddd
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Change PivotFilter on all pivot tables in workbook based on cell reference

    Quote Originally Posted by nailler167 View Post
    Hi all,

    I wanted to see if anyone can help with vba code on pivot tables

    I have a report Filter on my Pivot table. The macro that I have sets the Pivot filter to the date that I have entered in Cell "C3".

    Does anyone know how I can adapt the below code to update all pivot tables in my workbook without naming each individual Pivot table.


    Sub aab()

    Dim pi As PivotItem
    Worksheets("Jar").PivotTables("PivotTable38").PivotFields("Business_date").ClearAllFilters
    With Worksheets("Jar").PivotTables("PivotTable38").PivotFields("Business_date")



    For Each pi In .PivotItems
    pi.Visible = WorksheetFunction.CountIf(Worksheets("Report_Creator").Range("c3"), pi.Name) > 0
    Next pi

    End With
    End Sub

    It seems that what I am trying to do is not possible does anyone have an alternate solution ask

    I would be very grateful for any input.

    Thanks in advance
    Anyone able to help?

  3. #3
    Registered User
    Join Date
    03-28-2013
    Location
    ddddd
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Change PivotFilter on all pivot tables in workbook based on cell reference

    Does anyone know how to change the filter on multiple pivot tables based on a single cell reference?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1