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

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

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,101,927
Messages
5,483,740
Members
407,408
Latest member
chandika

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top