VBA change PivotTable Filters based on Values in dropdowns

Melimob

Active Member
Joined
Oct 16, 2011
Messages
395
Office Version
  1. 365
Hi there, been searching for some code to tweak but none of worked so far.

I have 3 dropdowns on a sheet: Year, Month, Introducer.
Same 3 are filters on a PivotTable5 on same sheet.
When user selects the dropdown values, I want the PivotTable filters to use the same.

I think therefore I need a change on worksheet event but for some reason nothing happens?

All responses gratefully received.

Many thanks
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Just to elaborate on this.
I have created a combobox which links the value to a cell.
I have added the code to a change event but still nothing is happening? At the moment I have just written one filter but I need to add two others.
Can anyone advise what is wrong with this code or do I have to put it somewhere else?

VBA Code:
Private Sub ComboBox1_Change()
On Error Resume Next
    
    Sheets("INTRODUCER DASHBOARD").PivotTables("PivotTable5").PivotFields("Introducer (Actual)").ClearAllFilters
    Sheets("INTRODUCER DASHBOARD").PivotTables("PivotTable5").PivotFields("Introducer (Actual)").CurrentPage = Sheets("INTRODUCER DASHBOARD").Range("R1").Value
  
End Sub

thanks in advance
 
Upvote 0

Forum statistics

Threads
1,214,826
Messages
6,121,795
Members
449,048
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top