Hi,
One way would be with the following two Sheet event macros. First protect the sheet then click in column A to record the Start Time, and right click in column A to record the end time. Column D is used as a test indicator.
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
ActiveSheet.Unprotect
If Range("D" & ActiveCell.Row) = "Started" Then
Range("C" & ActiveCell.Row) = Time
End If
Range("D" & ActiveCell.Row) = "Finished"
ActiveSheet.Protect
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
ActiveSheet.Unprotect
If Range("D" & ActiveCell.Row) <> "Started" Then
Range("B" & ActiveCell.Row) = Time
End If
Range("D" & ActiveCell.Row) = "Started"
ActiveSheet.Protect
End If
End Sub
Bookmarks