VBA change PivotTable Filters based on Values in dropdowns

Melimob

Active Member
Joined
Oct 16, 2011
Messages
387
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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Melimob

Active Member
Joined
Oct 16, 2011
Messages
387
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
 
Learn Excel from Bill Jelen

Understanding data is crucial, and the easiest place to start is with Microsoft Excel.

Forum statistics

Threads
1,151,611
Messages
5,765,415
Members
425,286
Latest member
CazzaBabes

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
Top