Hello i need a code to put in the page that will when i push the shift button on the keyboard it will unprotect the sheet but when i letgo of the sift button it will protect again.
when i push the shift button i also want it so i can only select specific cells
a1,a2,a3,a4,a5,a6,a7,b1,b2,b3,b4,b5,b6,b7 etc
i would also like it if i could include the following code
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Count > 1 Then Exit Sub
If Target.Row < 10 Then Exit Sub
If Target.Row > 28 Then Exit Sub
If Target.Row Mod 2 <> 0 Then Exit Sub
Application.ScreenUpdating = False
ActiveSheet.Unprotect
Cells(Target.Row, 4).Copy
Range("$D$4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Application.ScreenUpdating = True
End Sub
thanks for your help
when i push the shift button i also want it so i can only select specific cells
a1,a2,a3,a4,a5,a6,a7,b1,b2,b3,b4,b5,b6,b7 etc
i would also like it if i could include the following code
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Count > 1 Then Exit Sub
If Target.Row < 10 Then Exit Sub
If Target.Row > 28 Then Exit Sub
If Target.Row Mod 2 <> 0 Then Exit Sub
Application.ScreenUpdating = False
ActiveSheet.Unprotect
Cells(Target.Row, 4).Copy
Range("$D$4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Application.ScreenUpdating = True
End Sub
thanks for your help