worksheet protection

  • Thread starter Thread starter joec
  • Start date Start date
two macro's
protect and unprotect


Sub protect()
For Each sheet In Sheets
On Error Resume Next
sheet.Protect ("yourword")
Next
ActiveWorkbook.Protect ("yourword")
Application.StatusBar = ""
End Sub

Sub unprotect()
ActiveWorkbook.Unprotect ("yourword")
For Each sheet In Sheets
On Error Resume Next
sheet.Unprotect ("yourword")
Next
Application.StatusBar = "NOT sealed"
End Sub



Application.StatusBar = "NOT sealed"
this line indicates in the statusbar at the bottom of the excel window
whether the sheet is protected or not
when you install the macro link it to a shortcut key combination
 
Back
Top