Results 1 to 5 of 5

Unable to Clear Row Field Filters using code

Threaded View

  1. #1
    Registered User
    Join Date
    04-09-2020
    Location
    California, United States
    MS-Off Ver
    2016
    Posts
    9

    Unable to Clear Row Field Filters using code

    Hi all,

    All I want to do is put in a line or two of code that starts my macro out by clearing all existing filters on the pivot table. I've figured out how to clear the filters that are in the 'filter' field, but I cannot figure out how to clear the filters that are on my row headers.

    I've tried the code below to no avail.
    Thisworkbook.worksheets("sheet1").PivotTables("pivottable1").pivotfields("x").clearallfilters
    When I record and look at the code... this is what it gives me in VBA...

    ActiveSheet.Range("$A$30:$C$17356").AutoFilter Field:=1
    When I try to rerun only this portion of the recorded macro, it gives me an error. Autofilter Method of Range Class failed.

    What could be the issue?

    Thank you,
    Savetime
    Last edited by Savetime; 04-16-2020 at 12:31 PM. Reason: typo

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA to clear pivot filters
    By dancing-shadow in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2016, 10:42 AM
  2. [SOLVED] Clear filters
    By Len Silva in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-13-2015, 11:53 AM
  3. VBA code to disable clear all filters button
    By vstanojkovic in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2015, 07:09 AM
  4. [SOLVED] VB Code to clear Highlighed field
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-14-2014, 03:48 PM
  5. Button to clear filters
    By EdwardStephenson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2014, 05:14 AM
  6. Clear all filters
    By crs245 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-24-2013, 06:58 AM
  7. [SOLVED] Mandatory Field or unable to save based another field having data
    By jingles9 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 06-18-2013, 11:18 AM

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