Hello All,
I have a workbook with 13 worksheets in it.
I have a macro to protect all worksheets when the workbook is opened, but I would like one of the worksheet to remain unprotected.
Workbook_Open code:
Private Sub Workbook_Open()
Dim Sh As Worksheet
Application.ScreenUpdating = False
Application.WindowState = xlMaximized
ActiveWindow.WindowState = xlMaximized
For Each Sh In ThisWorkbook.Worksheets
Sh.Select
Sh.Protect userinterfaceonly:=True
Sh.EnableSelection = xlNoRestrictions
Sh.EnableAutoFilter = True
Sh.EnableOutlining = True
On Error Resume Next
Sh.ShowAllData
Err.Clear
Application.ScreenUpdating = True
End Sub
I have been trying to use a Worksheet_Activate macro to unprotect a worksheet called "FINANCIAL YR INSPECT & MONITOR" wihout success:
Private Sub Worksheet_Activate()
On Error Resume Next
ActiveSheet.Unprotect
End Sub
Is there a better way ???
Can someone please give me two explanations along with code suggestions:
- Can extra code be added to the Workbook_Open code to exclude a specific worksheet
- What am I doing wrong with the Worksheet_Activate macro
Thanking you in advance.
Regards,
Dave T