HI All,
I've been reading up about adding a stopwatch VBA in my sheet and make it really simple to use.
The sheet is to record time one is spending on their specific tasks. There is start time column, end time colum. And now I'm trying to add a break time column. I am using the following code to enter the start and end times by simply double clicking in the cells of the start time and end time columns:
The idea is to have the option of starting a stopwatch counter by double clicking a cell next to the latest cell I've entered the start time in. and then double click that same cell to stop the stopwatch counter. Then when I'm done with the task finally, I double click the cell in the end time column.
Two questions I have are:
1) how to combine the double click feature as to a stop clock as I already am using the "Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)" code.
2) how to tweak the above code to only capture the hours and minutes (HH:MM) and not the seconds(SS).
Thank you.
Reuben
I've been reading up about adding a stopwatch VBA in my sheet and make it really simple to use.
The sheet is to record time one is spending on their specific tasks. There is start time column, end time colum. And now I'm trying to add a break time column. I am using the following code to enter the start and end times by simply double clicking in the cells of the start time and end time columns:
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If Intersect(Target, Range("$B$2:$C$500")) Is Nothing Then Exit Sub
Target = Time
Cancel = True
End Sub
The idea is to have the option of starting a stopwatch counter by double clicking a cell next to the latest cell I've entered the start time in. and then double click that same cell to stop the stopwatch counter. Then when I'm done with the task finally, I double click the cell in the end time column.
Two questions I have are:
1) how to combine the double click feature as to a stop clock as I already am using the "Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)" code.
2) how to tweak the above code to only capture the hours and minutes (HH:MM) and not the seconds(SS).
Thank you.
Reuben