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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top