Use VBA to filter user selected pivot table field using user selected list

mbrowning

New Member
Joined
Oct 29, 2013
Messages
11
Hi all,
I've done a lot of searching and have tried to piece something together, with no luck, based on other responses. I know there are a lot of threads on the subject of filtering a pivot table with VBA, but my biggest challenge is that most macros are referencing a specific pivot table, a specific field, and/or a specific range where a list is stored.

Ideally, what I'd like to do is:
Start macro and
1) Have user select a field in a pivot table that is to be filtered, and then
2) Have user select a range where a list is stored

I can't quite mesh everything together where it can be any user selectable field in a pivot table based off a list that can be in any location and of any varying length. I'm hoping this isn't an impossible dream!

Thanks!!

Oh, and I'm using Excel 2010.
 

Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

mbrowning

New Member
Joined
Oct 29, 2013
Messages
11
It was so bad that I trashed the module unfortunately. I had some time to kill so I decided to take another stab at it, and I actually found 99% of what I was looking for, using a macro and using a plug in.

The macro I found is from Daily Dose of Excel » Blog Archive » Filtering Pivots based on external ranges. found under the 'faster approach' section.
It actually does exactly what I was asking for. That 1% I can't seem to figure out, though, is how to let it let me select a range found on another workbook. But that's trivial for now, because I can just put my list on the current workbook.

So that worked great for a regular pivot table. Then I tried it on an olap cube. Silly me, of course it's not going to work on an olap cube! Thankfully some wonderful person developed an olap pivot table add in that does the trick! OLAP PivotTable Extensions - Home

It's almost kind of sad how happy I am to find that add on :ROFLMAO:
 

Watch MrExcel Video

Forum statistics

Threads
1,102,291
Messages
5,485,968
Members
407,523
Latest member
Talicius

This Week's Hot Topics

Top