I am trying to protect a sheet when the user clicks off the sheet to another.
The following code does not error but it doesn't do what I expect it to - the sheet is still unprotected after I select another sheet.
What is the problem?
Thank You
The following code does not error but it doesn't do what I expect it to - the sheet is still unprotected after I select another sheet.
What is the problem?
Thank You
VBA Code:
Private Sub Worksheet_Deactivate()
Application.ScreenUpdating = False
Sheets("Welco").Protect UserInterfaceOnly:=True, AllowFiltering:=True, EnableOutlining:=True
Application.ScreenUpdating = True
End Sub