I am trying to use a code where I can double click in cell B, C, D and E and have it enter the time from my computer. It works ok...but I was wondering if there was a way that I can only limit it to a certain number of cells in those columns. For instance I only want it in cells B7:B13. and then B20:B26. Is there anything else I can do???
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column > 5 Then Exit Sub 'set for column "B7:B13""B:20:B26""C7:C13""C20:C26""D7:D13""D20:D26""E7:E13""E20:E26"Adjust as needed
Target = Time 'Change to Now for Time
Cancel = True
'
' Keyboard Shortcut: Ctrl+Shift+S
'
ActiveWorkbook.Save
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column > 5 Then Exit Sub 'set for column "B7:B13""B:20:B26""C7:C13""C20:C26""D7:D13""D20:D26""E7:E13""E20:E26"Adjust as needed
Target = Time 'Change to Now for Time
Cancel = True
'
' Keyboard Shortcut: Ctrl+Shift+S
'
ActiveWorkbook.Save
End Sub