+ Reply to Thread
Results 1 to 4 of 4

Macro Help Needed - Link Pivot Table Filter to Regular Table AutoFilter

  1. #1
    Registered User
    Join Date
    10-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Macro Help Needed - Link Pivot Table Filter to Regular Table AutoFilter

    I'm new to excel macro and new to this forum, and I have found a lot of helpful material here already.

    I need a macro that will automatically change a table's autofilter to the same selections/values of the pivot table filter when the pivot table's pivot filter is changed.

    For Exaple:
    I have a pivot table with a pivot filter Date in B3 with value 1/1/2011, 2/1/2011, and 3/1/2011

    I have a table(at A18) with a autofilter Date with the same value 1/1/2011.2/1/2011. 3/1/2011.

    What I would like to do is when I change the pivot filter in B3 (for example, select 1/1/2011 and 2/1/2011), the table autofilter will be set to 1/1/2011 and 2/1/2011.

    I would prefer to have two-way capabilities, but I can work with only one-way change.


    This is the code I came up with so far, it only works with single selections, but I would need multiple selection capabilities. I'm using Excel 2007

    Sub test2()
    Dim KEY As Variant: KEY = Sheets("Yesterday").Range("B3").Value
    Select Case KEY
    Case Is = "(All)"
    Sheets("Yesterday").Range("A18").AutoFilter Field:=2, Criteria1:=1
    Sheets("Yesterday").Range("A18").AutoFilter Field:=4
    Case Else
    Sheets("Yesterday").Range("A18").AutoFilter Field:=2, Criteria1:=1
    Sheets("Yesterday").Range("A18").AutoFilter Field:=4, Criteria1:=Sheets("Yesterday").Range("B3").Value
    End Select
    End Sub


    Thank you in advance for any help and insight!
    Last edited by ycx1129; 11-04-2011 at 02:50 PM.

  2. #2
    Registered User
    Join Date
    10-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Macro Help Needed - Link Pivot Table Filter to Regular Table AutoFilter

    Can anyone help with this? Thanks.

  3. #3
    Registered User
    Join Date
    10-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Macro Help Needed - Link Pivot Table Filter to Regular Table AutoFilter

    Can anyone help with this? Thanks.

  4. #4
    Registered User
    Join Date
    10-31-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Macro Help Needed - Link Pivot Table Filter to Regular Table AutoFilter

    Can anyone help with this? Thanks.

+ 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