oldmanwilly
Board Regular
- Joined
- Feb 24, 2016
- Messages
- 221
Hi
I want to control a pivot table with a combo box value as some people don't like to use the pivot table type filter. I have tried this code:
I have a combobox and the value is linked to cell a1, in C1 there is a vlookup that lookups the value of a1 brings back the same value in the combo box. I linked the above VBA to the control box and I thought when C1 would change it would filter the values that matched what was selected in the combo box but I get a message saying unable to get pivotfield property.
Any views on if this is the best way to go about filtering with a combo box or if my code just needs a syntax change?
Thanks
I want to control a pivot table with a combo box value as some people don't like to use the pivot table type filter. I have tried this code:
Code:
Sub weekly_select_region()
'
' weekly_select_region Macro
Sheets("compact summary").Select
ActiveSheet.PivotTables("pivottable8").PivotFields("risk level").Currentpage = Range("c1").Text
End Sub
I have a combobox and the value is linked to cell a1, in C1 there is a vlookup that lookups the value of a1 brings back the same value in the combo box. I linked the above VBA to the control box and I thought when C1 would change it would filter the values that matched what was selected in the combo box but I get a message saying unable to get pivotfield property.
Any views on if this is the best way to go about filtering with a combo box or if my code just needs a syntax change?
Thanks