Unprotect via prompt

  • Thread starter Thread starter gavmer
  • Start date Start date
G

gavmer

Hi all,

have a protected sheet that a user may need to amend. I therefore nee
a click event that will prompt for a password and unprotect the shee
so they can enter info. ANother click event to reprotect the sheet.

Thanks in advance all!!!!
 
Hi

Add a couple of buttons to the sheet, and then use the
following code :

Private Sub CommandButton1_Click()

ActiveSheet.Unprotect InputBox("Enter password to
unprotect sheet")

End Sub

Private Sub CommandButton2_Click()

ActiveSheet.Protect InputBox("Enter password to
protect sheet")


End Sub

Rgds

Rog
 

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