Try this...
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim pswdSheet2 As String
'store password to protect Sheet2, in Sheet4.Cells("B2")
pswdSheet2 = Sheet2.Cells(2, 2)
Sheet1.Unprotect Password:=pswdSheet2
If Not Intersect(Target, Range("E11:L14")) Is Nothing Then
Cancel = True
Range("E11:L14").Interior.ColorIndex = xlNone
Target.Interior.Color = RGB(141, 180, 226)
Cells(10, "D").Value = Cells(8, Target.Column).Value
ElseIf Not Intersect(Target, Range("E17:L18")) Is Nothing Then
Cancel = True
Range("E17:L18").Interior.ColorIndex = xlNone
Target.Interior.Color = RGB(141, 180, 226)
Cells(10, "D").Value = Cells(8, Target.Column).Value
End If
Sheet1.Protect Password:=pswdSheet2, UserInterFaceOnly:=True
End Sub
Bookmarks