Hi I have been given this VBA which perfectly restricts the use of drill-down in a pivot-table, however I found that is only works on the worksheet that the code is in Is there anyway to sort it so it works on any pivot-table within the workbook file ?
Sorry, but I am a new user on VBA !
Sub RestrictPTuse()
Dim p As PivotField
With Sheets("table").PivotTables("PivotTable1")
.EnableDrilldown = False
.EnableWizard = False
.PivotCache.EnableRefresh = True
For Each p In .PivotFields
p.DragToData = False
p.DragToHide = False
p.DragToColumn = False
p.DragToRow = False
p.DragToPage = False
Next p
End With
End Sub
Thanks for your help
Amy xx
Bookmarks