Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Charles1732
 
Posts: n/a
Default 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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro to copy and edit then delete a worksheet lschuh Excel Discussion (Misc queries) 13 July 27th 05 09:02 PM
how to include real time & date on a worksheet nde Excel Discussion (Misc queries) 1 March 23rd 05 06:43 PM
Time Sheets Lady Layla Excel Discussion (Misc queries) 1 March 23rd 05 03:22 PM
How do I open to a specific worksheet every time? TNT New Users to Excel 2 February 6th 05 12:06 PM
time formatting and time categorizing (vlookup or data validation) MarianneR Excel Worksheet Functions 4 November 18th 04 03:24 PM


All times are GMT +1. The time now is 09:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"