Hello,
I have a pivot table with a filter applied. I do not want users to inadvertently clear this filter.
I have been researching how to disable a pivot filter using VBA and found the following VBA code: ActiveSheet.PivotTables(1).RowFields(2).EnableItemSelection = False
This seems to be the code I need but I am having trouble implementing it due to my limited VBA experience.
The name of my pivot table is called "OL" and the filter I want to disable is on row 18. here is what I have tried:
Sub BLOCK()
Dim wks As Worksheet
ActiveSheet.PivotTables("OL").RowFields(18).EnableItemSelection = False
End Sub
This does not appear to work however. Any help with VERY appreciated.
Thank you!
I have a pivot table with a filter applied. I do not want users to inadvertently clear this filter.
I have been researching how to disable a pivot filter using VBA and found the following VBA code: ActiveSheet.PivotTables(1).RowFields(2).EnableItemSelection = False
This seems to be the code I need but I am having trouble implementing it due to my limited VBA experience.
The name of my pivot table is called "OL" and the filter I want to disable is on row 18. here is what I have tried:
Sub BLOCK()
Dim wks As Worksheet
ActiveSheet.PivotTables("OL").RowFields(18).EnableItemSelection = False
End Sub
This does not appear to work however. Any help with VERY appreciated.
Thank you!