+ Reply to Thread
Results 1 to 5 of 5

Autofilter fails on pivottable

  1. #1
    Forum Contributor
    Join Date
    06-19-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Office365
    Posts
    273

    Autofilter fails on pivottable

    Hello I need help with the following codes:

    the buildingsumsh has a pivot table that updates monthly with new month data summarized (see the pic attached).

    what this code is doing is to find the newly added month column and go to the next cell beside it and put autofilter on months. Then I need to filter on the newly added column and only show the non zero values on that column, the line filterRng.AutoFilter Field:=lastcol, Criteria1:="<>0" errs out.

    it must be because of the way the autofilter is being added by using the selection.autofilter. can someone please help me make this work? thanks so much.

    Please Login or Register  to view this content.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by lynnsong986; 08-07-2020 at 01:52 PM.

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Autofilter fails on pivottable

    Please attach an EXCEL sample file
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Contributor
    Join Date
    06-19-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Office365
    Posts
    273

    Re: Autofilter fails on pivottable

    Hello I've made a sample workbook with simplified data. Thanks so much for your help.

  4. #4
    Forum Contributor
    Join Date
    06-19-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Office365
    Posts
    273

    Re: Autofilter fails on pivottable

    I figured it out, just for someone who needs the same thing:

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Autofilter fails on pivottable

    Great, Thx for the feedback

+ 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. After updating PivotTable Source data with Macro, slicer doesn't show PivotTable
    By mrdouglaswee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2018, 02:10 AM
  2. Autofilter inside pivottable
    By BBos01 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 01-01-2017, 09:54 AM
  3. Create PivotTable Based On A PivotTable
    By goss in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 02-10-2014, 03:47 PM
  4. PivotTable Autofilter -- RunTime Error 1004
    By bcn1988 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-11-2013, 11:22 AM
  5. Replies: 0
    Last Post: 02-06-2013, 09:13 PM
  6. Shift rows below PivotTable down when PivotTable expands (PowerPivot)
    By hektisk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-06-2012, 10:19 PM
  7. Setting CommandText property of PivotCache fails if cache has >1 PivotTable
    By ashortxl in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-20-2005, 06:06 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