+ Reply to Thread
Results 1 to 1 of 1

Filter pivot item by date - type mismatch

  1. #1
    Registered User
    Join Date
    09-21-2018
    Location
    Montreal, Canada
    MS-Off Ver
    MS office 2010
    Posts
    3

    Filter pivot item by date - type mismatch

    I need help filtering pivot items with a date range. The items are dates in the format YYYY-MM-DD between 2014 and 2018. I would like for only the items of the past 12 months to be visible in the pivot table.

    The code I came up with first checks all the items in the drop-down list of the pivot table. Then it should uncheck all items that are not within the 12 months range.

    Problem: the code does not filter anything, therefore all items are still visible.

    Please Login or Register  to view this content.
    I used the watch window to see the value and type of the variables as the code goes through the For Each loop. It seems that I have a type mismatch issue with the pivot.visible = true/false method. Any ideas what could be the problem? I included a screenshot of the watch window.
    Ex.:For the item 2014-01-01, i should get a pivot.visible= false of value "true" and of type "boolean", but i get type mismatch & Integer.

    debug12.JPG
    Last edited by mushkitoes; 09-21-2018 at 02:37 PM.

+ 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. Type Mismatch Adding Pivot Table Through VBA
    By jo15765 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-18-2017, 01:08 PM
  2. [SOLVED] Listbox item not rounding to 2 decimals - Runtime error 13 Type mismatch
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-20-2016, 09:18 AM
  3. Pivot cache using vba - Type mismatch error
    By sahilkh18 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-11-2016, 08:07 AM
  4. Replies: 1
    Last Post: 12-12-2014, 06:46 AM
  5. Filter array type mismatch
    By stylecrazy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-23-2013, 09:16 AM
  6. type mismatch while trying to filter and copy rows and paste to another worksheet
    By perducci in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2012, 02:59 PM
  7. Type Mismatch on Pivot Table creation
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-10-2011, 04:51 PM

Tags for this Thread

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