+ Reply to Thread
Results 1 to 6 of 6

Pivot Table Filter Macro Error

  1. #1
    Registered User
    Join Date
    12-06-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    46

    Pivot Table Filter Macro Error

    Good Evening All,
    In my spreadsheet, I have variable data; however, I have a specific set of attributes that I'd want to be filtered upon if/when they do appear in the data run for that week. If they do not appear, I'd like the Pivot Table filter to skip over it and continue to the next.
    Unfortunately, I keep getting debugging errors when I try to run my macro. Can anyone help?

    I.E.
    If "1G1N13S2" isn't in the variable [raw] data, it'd carry me straight to the VBA to debug instead of skipping over it (whether false or true) to continue on to the subsequent ID#.


    Please Login or Register  to view this content.
    Any help, I'd GREATLY appreciate.

  2. #2
    Registered User
    Join Date
    12-06-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    46

    Re: Pivot Table Filter Macro Error

    . .
    Last edited by kibbles; 08-28-2014 at 11:59 AM.

  3. #3
    Registered User
    Join Date
    12-06-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    46

    Re: Pivot Table Filter Macro Error

    Still no ideas?

  4. #4
    Registered User
    Join Date
    12-06-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    46

    Re: Pivot Table Filter Macro Error

    So, I've gotten an answer as to how to fix this.

    On Error Resume Next
    With ActiveSheet.PivotTables("PivotTable1").PivotFields("ACTIVITY_ID")
    .PivotItems("1G1N13S2").Visible = False
    .PivotItems("1G1N2SAN").Visible = False
    .PivotItems("1G1N5ACC").Visible = False
    .PivotItems("1G1N5SCI").Visible = False
    .PivotItems("1G1N5SDV").Visible = False
    .PivotItems("E6T66ZJA").Visible = True
    End With
    On Error Goto 0

  5. #5
    Registered User
    Join Date
    12-06-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    46

    Re: Pivot Table Filter Macro Error

    double-post

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Pivot Table Filter Macro Error

    Hi kibbles,

    I wrote code to filter pivot data last year. I found that as soon as I filtered out all possible data, I got VBA errors. My answer was to make all items.visible = true to start with and then turn off what I didn't want to show.

    I like your answer to On Error Resume Next. I don't think I ever tried that approach. Hope it works for you and thanks for sharing your answer.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro that would filter pivot table top 10 items
    By weecha in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-29-2013, 01:28 PM
  2. Pivot Table Macro to Auto Filter
    By DaFonz01 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-13-2012, 12:27 PM
  3. VBA Pivot Table Filter Macro
    By bobo1000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2012, 05:54 AM
  4. Macro to filter Pivot Table by range
    By dharmaskibum in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-25-2012, 04:21 PM
  5. Macro Help Needed - Link Pivot Table Filter to Regular Table AutoFilter
    By ycx1129 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-11-2011, 12:54 PM

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