+ Reply to Thread
Results 1 to 3 of 3

Pivot Filter Macro - Auto Update to select previous 30 days.

  1. #1
    Registered User
    Join Date
    07-10-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    Pivot Filter Macro - Auto Update to select previous 30 days.

    Hi There,

    Let me start by thanking everyone in advance for their suggestions. At work we have several reports to fill out on a daily basis; we have a pivot table that pulls all the info we could possibly want from a server location so ultimately everyone just needs to manipulate the table to show their specific report. In the interest of making it totally fool proof I've created macros that automatically fill out everyone's individual reports. All the pivot table have Dates in the row labels with each row representing 1 day in the format MM/DD/YYYY. Here's the one part I haven't been able to work out myself; the reports are only supposed to include the previous 30 days not including today and I haven't quite worked out how to code that. What I would like is for someone to provide some code that can determine what dates fall into the previous 30 days (not including today) and auto select those dates within my field filter. Unfortunately I can't attach a sample doc since excel is pulling the data from a network location but if this isn't clear enough I'll create a sample doc with dummy data.

    Any help will be greatly appreciated! Thanks again!

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Pivot Filter Macro - Auto Update to select previous 30 days.

    If possible you can allot a helper column in your source data and use formula like the below to determine the required data to get displayed in pivot and use that column in your pivot for filtering data.

    =IF(AND(A1>=(TODAY()-30),A1<=TODAY()),"Yes","")


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    07-10-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Pivot Filter Macro - Auto Update to select previous 30 days.

    Quote Originally Posted by :) Sixthsense :) View Post
    If possible you can allot a helper column in your source data and use formula like the below to determine the required data to get displayed in pivot and use that column in your pivot for filtering data.

    =IF(AND(A1>=(TODAY()-30),A1<=TODAY()),"Yes","")
    Hey Sixth Sense, thanks for your reply that's a good idea. Unfortunately, I don't have access to the source data since it's all contained on a server and is uploaded automatically. I'll talk to my IT guys and see if we can implement an extra field like this. In the meantime is there anyone that can suggest a method that doesn't involve modifying the source data?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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