Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
i am working on files in excel where i need to keep track of how long the
files have been open, so that I can complete a timesheet for billing purposes. Is there anyway to track this information within the excel file(s) itself? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Insert a new worksheet in your workbook.
In A1 enter Date In B1 enter Time Opened In C1 enter Time Closed In D1 enter Working Time In D2 enter =IF(C2="","",C2-B2) In Thisworkbook module paste this code. Private Sub Workbook_Open() Dim rng As Range Set rng = Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0) With rng .Value = Format(Date, "mm/dd/yyyy") .Offset(0, 1).Value = Format(Time, "hh:mm:ss") End With End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim rng As Range Set rng1 = Sheets("Sheet1").Cells(Rows.Count, 3).End(xlUp).Offset(1, 0) If rng1.Offset(0, -1).Value = "" Then Exit Sub rng1.Value = Format(Time, "hh:mm:ss") ThisWorkbook.Save End Sub Gord Dibben MS Excel MVP On Tue, 14 Jul 2009 07:13:01 -0700, RAMJET wrote: i am working on files in excel where i need to keep track of how long the files have been open, so that I can complete a timesheet for billing purposes. Is there anyway to track this information within the excel file(s) itself? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
When i open excel file it takes time to open | Excel Discussion (Misc queries) | |||
How can I accumulate time in a flight log? | Excel Discussion (Misc queries) | |||
Can Excel open a new application every time you open a file? | Setting up and Configuration of Excel | |||
Accumulate weekly time to total time in Excel. | Excel Discussion (Misc queries) | |||
How do I stop Excel from closing the open file each time I open a. | Setting up and Configuration of Excel |