View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Fusion1337 Fusion1337 is offline
external usenet poster
 
Posts: 5
Default protecting and unprotecting

Thanks, that worked nicely

Private Sub Worksheet_Change(ByVal target As Range)
If Intersect(target, Range("a1")) Is Nothing Then Exit Sub
'MsgBox "HI"
If target 10 Then
ActiveSheet.Unprotect Password:="pw"
Range("b1").Locked = False
ActiveSheet.Protect Password:="pw"
Else
ActiveSheet.Unprotect Password:="pw"
Range("b1").Locked = True
ActiveSheet.Protect Password:="pw"
End If
End Sub