.
Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column = 11 Then 'MsgBox "column 11 is clicked"
With Sheet1
.Unprotect
With Target
.Font.ColorIndex = 4
.Value = Environ("username") & " " & Format(Now(), "dd/mm/yyyy hh:mm:ss AM/PM")
End With
If CDbl(Time) > .Cells(Target.Row, 4) Then Target.Font.ColorIndex = 3
.Protect
Cancel = True
End With
End If
If Target.Column = 12 Then 'MsgBox "column 11 is clicked"
With Sheet1
.Unprotect
With Target
.Font.ColorIndex = 4
.Value = Environ("username") & " " & Format(Now(), "dd/mm/yyyy hh:mm:ss AM/PM")
End With
If CDbl(Time) > .Cells(Target.Row, 5) Then Target.Font.ColorIndex = 3
.Protect
Cancel = True
End With
End If
End Sub
Bookmarks