• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Code to change Pivot Table filter based on cell value

carics

Member
Hello,


I am setting up a dashboard, and for that I would need that some Pivot Tables would filter themselves based on the value on a specific cell.


I got this code until now:


Sheets("INDEX").PivotTables("SFCClusterPT").PivotFields("cluster").CurrentPage = Range("BC21").Value


I re-checked all sheet, PTable and Field names for a mispell and also the reference cell. All seems to be OK but I still get: "Run-time error '1004': Application-defined or object-defined error". With the debug I see it is that line that is causing the trouble...


The weirdest thing is that I used that code already in another worksheet as a test a couple months ago and it worked fine! I cannot understand why it is not working now.


Do you have any hints on this one?


Thanks a lot!
 
GOT IT!


In the field options I unticked the "Select Multiple Items" option and now it works... damn, that took me long enough!


Thank you anyway for those who read this!
 
Back
Top