Hello All -
I have a workbook with 35 sheets on a shared drive at work. Recently someone deleted things they weren't supposed to and all hell broke loose. After unlocking all the cells the user should be using I would like to find a code that does the following if possible:
I believe the below code should protect the sheets on open if I make an original With statement for each sheet and still allow users to be able to access the group/ungroup buttons. Am I correct here for item 1 on the list, or am I off on something?
Private Sub Workbook_Open()
With Sheet1
.Protect Password:="password", UserInterfaceOnly:=True
.EnableOutlining = True
End With
End Sub
#2 on the list I'm completely lost on, however. Any help here would be most appreciated.
I have a workbook with 35 sheets on a shared drive at work. Recently someone deleted things they weren't supposed to and all hell broke loose. After unlocking all the cells the user should be using I would like to find a code that does the following if possible:
- Protects all sheets automatically on open with the same password regardless of the status of those sheets the last time they were exited.
- If the person in charge of maintaining the file unprotects a sheet with a correct password, automatically unprotect all sheets in the workbook.
I believe the below code should protect the sheets on open if I make an original With statement for each sheet and still allow users to be able to access the group/ungroup buttons. Am I correct here for item 1 on the list, or am I off on something?
Private Sub Workbook_Open()
With Sheet1
.Protect Password:="password", UserInterfaceOnly:=True
.EnableOutlining = True
End With
End Sub
#2 on the list I'm completely lost on, however. Any help here would be most appreciated.
Last edited: