+ Reply to Thread
Results 1 to 2 of 2

VBA Code to filter rolling dates from a pivot table

  1. #1
    Registered User
    Join Date
    09-25-2014
    Location
    St. Louis, MO
    MS-Off Ver
    2010
    Posts
    5

    VBA Code to filter rolling dates from a pivot table

    Looking for help with a bit a bit of code that will allow me to filter specific data in a pivot table. Basically I need to select the next six dates, starting with today's date, but can't seem to deselect "all" in the filter prior to selecting the dates that I need. Unfortunately the dates within the table change, so I'm not able to code in specifically which dates to deselect since it changes every day. There are probably multiple ways of accomplishing this, but I can't seem to get any of them to work. Any help is much appreciated!



    ActiveSheet.PivotTables("PivotTable1").PivotFields("Check-In Date"). _
    EnableMultiplePageItems = True
    ActiveSheet.PivotTables("PivotTable1").PivotFields("Check-In Date"). _
    CurrentPage = "(All)" '<-------- Any ideas of how to get this to uncheck all dates?
    With ActiveSheet.PivotTables("PivotTable1").PivotFields("Check-In Date"). _ClearAllFilters
    .PivotItems("9/25/2014").Visible = True '<------- "9/25/2014" will need to be changed to Date() or a variable that is assigned to the same functionality, but this is just an example

  2. #2
    Registered User
    Join Date
    09-25-2014
    Location
    St. Louis, MO
    MS-Off Ver
    2010
    Posts
    5

    Re: VBA Code to filter rolling dates from a pivot table

    Should I assume that this isn't possible or am I not explaining well enough what I'm trying to accomplish?

+ 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. Why my Pivot Table Filter shows individual dates
    By chico.corrales in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 03-28-2016, 05:52 AM
  2. [SOLVED] VBA code to filter on Specific two dates ( pivot table)
    By tejal in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-24-2014, 03:36 PM
  3. Select Multiple Dates In Report Filter Pivot Table But Dates Are Not Static
    By biasedobserver in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-06-2014, 03:38 PM
  4. Filter Pivot Table between dates referenced in cell
    By tkleypas13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-05-2013, 04:42 PM
  5. Auto update pivot table filter dates
    By kaitco in forum Excel General
    Replies: 5
    Last Post: 11-19-2010, 01:40 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