I have some code that enables me to remove a lot of the pivot table functionality and it works fairly well, but I also want it to remove the ability to filter on any column. My goal is to basically keep the pivot table formatting and data without allowing any manipulation of the data. I've tried all of the copy/paste special methods I've found online, but none of them truly keep the original formatting.
Here is the code I use to remove certain user abilities:
Sub AllowPivotTable()
'pivot table tutorial by contextures.com
Dim pt As PivotTable
Dim pf As PivotField
Set pt = ActiveSheet.PivotTables(1)
With pt
.EnableWizard = False
.EnableDrilldown = False
.EnableFieldList = False 'Excel 2002+
.EnableFieldDialog = False
.PivotCache.EnableRefresh = False
End With
End Sub
Can I modify this to essentially remove every user ability, so that they can only see the data? For now, I think removing the ability to filter is the most important.
Bookmarks