j2jake
asked on
change pivot table filter
Hi Experts!
Newbie here in excel VBA. I need to change the pivot table filter when the user chooses which month to display. It should show the trailing 4 months from the chosen month and year and the last year of the chosen month. I have uploaded a sample data.
In the selection sheet, "November" and "2009" is chosen so the pivot table shows 6 month filters. They are "2008-11", "2009-07","2009-08","2009- 09","2009- 10" and "2009-11".
Thanks so much!
Newbie here in excel VBA. I need to change the pivot table filter when the user chooses which month to display. It should show the trailing 4 months from the chosen month and year and the last year of the chosen month. I have uploaded a sample data.
In the selection sheet, "November" and "2009" is chosen so the pivot table shows 6 month filters. They are "2008-11", "2009-07","2009-08","2009-
Thanks so much!
Just change the selection in the Selection sheet and refresh the pivot table.
If you want the no of trailing to be dynamic instead of fixed as 4, that can also be done.
Regards,
Joydip
If you want the no of trailing to be dynamic instead of fixed as 4, that can also be done.
Regards,
Joydip
ASKER
hi joydip!
thanks so much!
can you explain to me a bit of how this works?
how can you set the trailing to be fixed as 4 or to any number?
thanks so much!
can you explain to me a bit of how this works?
how can you set the trailing to be fixed as 4 or to any number?
ASKER
hi again!
i got the logic. thanks!
how can you set it up to be fixed as 4?
is there another way to like change the pivot filter using vba? what i really wanted to do is to only have the user interaction through the selection sheet. so after choosing the month and year, the pivot automatically changes without it being refreshed.
i got the logic. thanks!
how can you set it up to be fixed as 4?
is there another way to like change the pivot filter using vba? what i really wanted to do is to only have the user interaction through the selection sheet. so after choosing the month and year, the pivot automatically changes without it being refreshed.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
ASKER
test.xls