Results 1 to 10 of 10

Filter on pivot table values after pivotupdate event

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,946

    Filter on pivot table values after pivotupdate event

    Hi Guys,

    i have pivot table like here:
    Screenshot_1.png

    and what i want is to add filter on values to exclude values <> 0.
    Manually when i am setting this up it is working like a charm without any issues.

    I recorded even macro to this via VBA but i am getting error:
    Autofilter method of range class failed.

    Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
    
    Dim AddressPivot As Range
    Dim strAddress As String
    
        ActiveSheet.Range("$A$1:$C$10").AutoFilter Field:=3, Criteria1:=Array("165" _
            , "22", "55", "88"), Operator:=xlFilterValues
            
        ActiveSheet.Range("$A$1:$C$10").AutoFilter Field:=3
     
    End Sub
    Code to this is like above.
    The perfect solution would be to take address from target pivot table and use it to filter specific field.

    Please help,
    Jacek
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Deactive Pivotupdate while updating Filter VBA
    By andershess in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-02-2017, 09:07 AM
  2. Replies: 2
    Last Post: 12-18-2016, 08:37 PM
  3. Filter values in pivot table
    By netskyblue in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 05-24-2016, 05:07 AM
  4. Pivot table Filter event
    By haissk in forum Excel General
    Replies: 2
    Last Post: 07-10-2014, 08:45 AM
  5. [SOLVED] How do I filter Pivot Table Values?
    By flyboy54 in forum Excel Charting & Pivots
    Replies: 21
    Last Post: 05-24-2013, 10:17 AM
  6. Excel 2007 : How to Filter TOP 5 Values in PIVOT Table
    By yourskarthik in forum Excel General
    Replies: 3
    Last Post: 12-30-2009, 11:26 AM
  7. filter pivot table with multiple values?
    By hamsup1o in forum Excel General
    Replies: 0
    Last Post: 09-29-2009, 04:08 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