Code: Select all
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("C1")) Is Nothing Then
'Code here
End If
End Sub
so as not to run code if sheet is protected.
Code: Select all
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("C1")) Is Nothing Then
'Code here
End If
End Sub
Code: Select all
If ActiveSheet.ProtectContents = True Then Cancel = True
Thank you mbarronmbarron wrote:Something like this at the begining should do it:
Code: Select all
If ActiveSheet.ProtectContents = True Then Cancel = True
Code: Select all
If ActiveSheet.Protect = True then
Code: Select all
If ActiveSheet.ProtectContents = True Then
MsgBox ("Sheet is protected")
Exit Sub
End If