Refresh pivot table and report in protected sheets

deodion

New Member
Joined
Dec 9, 2008
Messages
8
I have sheet-a, it contains pivots only, only allows select locked/unlocked/autofilter,
and sheet-b, it contains pivot chart, only allows select locked/unlocked/use pivot table & report,

sheet-c contains both pivot and report, only allows select locked/unlocked/use pivot table & report,

some other sheets with table only, only allows select locked/unlocked/autofilter,

they are all protected sheets,

what is the efficient way to refresh protected sheets which contain pivot table and/or pivot report?

the goal is to let user only input selected cells in other sheets,
while sheet-abc, they only can use pivot table & report and/or autofilter,

I have below from other source, but I dont want to make all sheets AllowUsingPivotTables:=True
Perhaps, I only need the adjusted code where it can simply unprotect/protect each desired sheet

I dont know any VBA,

VBA Code:
Sub UnprotectRefreshAll()
Dim ws As Worksheet
On Error Resume Next

For Each ws In ActiveWorkbook.Worksheets
    ws.Unprotect Password:="mypassword"
Next ws

ActiveWorkbook.RefreshAll

For Each ws In ActiveWorkbook.Worksheets
  ws.Protect Password:="mypassword", _
        AllowUsingPivotTables:=True
Next ws
    
End Sub

thank you,
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,223,880
Messages
6,175,154
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top