Event/Method for Unprotecting worksheet

  • Thread starter Thread starter jpendegraft
  • Start date Start date
J

jpendegraft

I am trying to allow a user to insert a picture object onto a protected
worksheet in selected cells.

I assume the best method would be to unprotect the worksheet when the
user selects a particular cell and then reprotect it when the
leave....

I have put together the following code but don't have the correct
event/method as it is not firing off...

Any help would be greatly appreciated....




Private Sub Worksheet_Change(ByVal Target As Range)

On Error Resume Next
If ActiveCell.Range("C2:AL2", "C14:AL14", "C26:AL14").Select Then
ActiveSheet.Unprotect
Else: ActiveSheet.Protect True, True, True, True

End Sub
 

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