You could add a LOG sheet, hidden in your workbook. Then in the ThisWorkbook code module of that workbook you could use these EVENT macros... one to write time the timestamp when the workbook took focus (you started working on it), and another to timestamp when the workbook loses focus.
Private Sub Workbook_Activate()
ThisWorkbook.Sheets("Log").Range("A" & Rows.Count).End(xlUp).Offset(1) = Now
End Sub
Private Sub Workbook_DeActivate()
ThisWorkbook.Sheets("Log").Range("A" & Rows.Count).End(xlUp).Offset(, 1) = Now
ThisWorkbook.Sheets("Log").Range("A" & Rows.Count).End(xlUp).Offset(, 2).FormulaR1C1 = "=RC[-1]-RC[-2]"
End Sub
Be sure to Format column C of these LOG sheets as [h]:mm:ss
Bookmarks