Sub Protect()
Application.ScreenUpdating = False
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
With sh
.Visible = xlSheetVisible
.Unprotect Password:="0000"
.EnableAutoFilter = True
.EnableOutlining = True
.Cells.Locked = False
On Error Resume Next
.Cells.SpecialCells(xlCellTypeFormulas, 23).Locked = True
.Cells.SpecialCells(xlCellTypeConstants, 2).Locked = False
On Error GoTo 0
.Protect Password:="0000", _
AllowFormattingCells:=True, _
AllowFormattingColumns:=True, _
AllowFormattingRows:=True, _
AllowInsertingColumns:=True, _
AllowInsertingRows:=True, _
AllowInsertingHyperlinks:=True, _
AllowDeletingColumns:=True, _
AllowDeletingRows:=True, _
AllowSorting:=True, _
AllowFiltering:=True, _
AllowUsingPivotTables:=True, _
userinterfaceonly:=True
End With