Hello! I am trying to create code that once a user click on the tab “LeadershipSoftwareOverview” the sheet will be unprotected, the pivot table on that tab (labeled “ResourceSummary”) refreshed and then the sheet reprotected. Below is what I have and it is not working. TIA!!
Private Sub Worksheet_Activate()
ActiveSheet.Unprotect Password:="850"
Sheets("LeadershipSoftwareOverview").PivotTables("ResourceSummary").RefreshTable
ActiveSheet.Protect Password:="850"
End Sub
Private Sub Worksheet_Activate()
ActiveSheet.Unprotect Password:="850"
Sheets("LeadershipSoftwareOverview").PivotTables("ResourceSummary").RefreshTable
ActiveSheet.Protect Password:="850"
End Sub