Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Cumulative Time Usage in a Worksheet
Does anyone know how to build a time clock into a worksheet that will track
the cumulative time the worksheet is used for each opening and closing of the worksheet? -- Charles1732 |
#2
|
|||
|
|||
Create a Public variable called nTime in a standard code module, and add
this code to your workbook Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) With Worksheets("Sheet1").Range("a1") .Value = .Value + (Now - nTime) End With End Sub Private Sub Workbook_Open() nTime = Now End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH Bob Phillips "Charles1732" wrote in message ... Does anyone know how to build a time clock into a worksheet that will track the cumulative time the worksheet is used for each opening and closing of the worksheet? -- Charles1732 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro to copy and edit then delete a worksheet | Excel Discussion (Misc queries) | |||
how to include real time & date on a worksheet | Excel Discussion (Misc queries) | |||
Time Sheets | Excel Discussion (Misc queries) | |||
How do I open to a specific worksheet every time? | New Users to Excel | |||
time formatting and time categorizing (vlookup or data validation) | Excel Worksheet Functions |