Hi - I seem to have swapped one error for another.
Objective: Combobox ActiveX dropdown > once clicked changes filters on PivotTable.
I have looked at code and got issue on '1004 error" when attempting to set the "CurrentPage" property of the PivotField class.
I searched and recorded a macro and ended up with the below amendments but now am getting 'Type Mismatch'.
I feel I am really close.. any advice greatly received.
FYI - I need to set 3 filters based on 1 combox activex box (which uses data in data model in PivotTable) and 2 x normal drop downs. The PowerPivot is linked to cell R1 hence that's the cell I'm referencing as change.
Many thanks
Melissa
Objective: Combobox ActiveX dropdown > once clicked changes filters on PivotTable.
I have looked at code and got issue on '1004 error" when attempting to set the "CurrentPage" property of the PivotField class.
I searched and recorded a macro and ended up with the below amendments but now am getting 'Type Mismatch'.
I feel I am really close.. any advice greatly received.
FYI - I need to set 3 filters based on 1 combox activex box (which uses data in data model in PivotTable) and 2 x normal drop downs. The PowerPivot is linked to cell R1 hence that's the cell I'm referencing as change.
VBA Code:
Option Explicit
Sub ChangePiv()
Dim pt As PivotTable
Dim pf As PivotField
Dim str As String
Set pt = Sheet21.PivotTables("PivotTable5")
Set pf = pt.PivotFields("[LeadData].[Introducer (Actual)].[Introducer (Actual)]")
str = Array("[LeadData].[Introducer (Actual)].&[" & Worksheets("INTRODUCER DASHBOARD").Range("R1").Value & "]")
With pt
pf.ClearAllFilters
pf.VisibleItemsList = str
End With
End Sub
Many thanks
Melissa