K
Kevin Gallagher
If you have a second, can you help a try-hard programmer……..
i have some of what I need (see below), However I can’t do one las
thing….can anyone recommend any code that would prevent the user fro
selecting any of the dropdown boxes (e.g. unable to use the filter) o
the pivot table.
note: I still need to allow them to drilldown to the detail on th
selections provided if required…..
I imagine it would be something like pf.?????? = false
I just don’t know what the ???? bit is.
Know any good sites for this type of question?
Private Sub Workbook_Open()
Dim ws As Worksheet
Dim pt As PivotTable
On Error Resume Next
For Each ws In ActiveWorkbook.Worksheets
ws.Unprotect Password:="MySecretWord"
For Each pt In ws.PivotTables
pt.RefreshTable
Next
ws.Protect DrawingObjects:=True, _
Contents:=True, Scenarios:=True, AllowUsingPivotTables:=True
Password:="MySecretWord"
Next
Dim pf As PivotField
With Worksheets("Pivot").PivotTables(1)
.EnableWizard = False
.EnableDrilldown = False
.PivotCache.EnableRefresh = True
For Each pf In .PivotFields
pf.DragToPage = False
pf.DragToRow = False
pf.DragToColumn = False
pf.DragToData = False
pf.DragToHide = False
Next pf
End With
End Sub
All help appreciated
Cheers
Kevin Gallaghe
i have some of what I need (see below), However I can’t do one las
thing….can anyone recommend any code that would prevent the user fro
selecting any of the dropdown boxes (e.g. unable to use the filter) o
the pivot table.
note: I still need to allow them to drilldown to the detail on th
selections provided if required…..
I imagine it would be something like pf.?????? = false
I just don’t know what the ???? bit is.
Know any good sites for this type of question?
Private Sub Workbook_Open()
Dim ws As Worksheet
Dim pt As PivotTable
On Error Resume Next
For Each ws In ActiveWorkbook.Worksheets
ws.Unprotect Password:="MySecretWord"
For Each pt In ws.PivotTables
pt.RefreshTable
Next
ws.Protect DrawingObjects:=True, _
Contents:=True, Scenarios:=True, AllowUsingPivotTables:=True
Password:="MySecretWord"
Next
Dim pf As PivotField
With Worksheets("Pivot").PivotTables(1)
.EnableWizard = False
.EnableDrilldown = False
.PivotCache.EnableRefresh = True
For Each pf In .PivotFields
pf.DragToPage = False
pf.DragToRow = False
pf.DragToColumn = False
pf.DragToData = False
pf.DragToHide = False
Next pf
End With
End Sub
All help appreciated
Cheers
Kevin Gallaghe