Accumulating time working on a spreadsheet

GallowayJay

New Member
Joined
Apr 8, 2002
Messages
15
I work with Excel files often. On occassion, I am asked how many hours/minutes I put into a specific file. So, if I spend 2 hours in a spreadsheet, I want a calculation that will add up the time, and display 2 hours. Does someone know how to calculate the exact you spend in a specific spreadsheet? I don't want to use the TODAY() function as it will automatically update with incorrect data. Thanks as always for all the help.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Brian from Maui

MrExcel MVP
Joined
Feb 16, 2002
Messages
8,458
Jay,

I doubt this is what you want but this may help. In properties and the statistics tab, there is a total editing time.
 

ylijohe

Board Regular
Joined
Sep 6, 2002
Messages
58
Sub startingtime()
'
' startingtime Macro
' Macro recorded 19.9.2002 by YLIJOHE
'
' Keyboard Shortcut: Ctrl+Shift+S
'
ActiveCell.FormulaR1C1 = "=NOW()"
Selection.Copy
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End Sub
Sub STOPtimecount()
'
' STOPtimecount Macro
' Macro recorded 19.9.2002 by YLIJOHE
'
' Keyboard Shortcut: Ctrl+Shift+T
'
Range("A2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=NOW()"
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range("A3").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=R[-1]C-R[-2]C"
Selection.NumberFormat = "mm:ss.0"
Range("A1:A3").Select
Selection.NumberFormat = "h:mm"
End Sub

Is this what You are looking for?
Obviously You are looking for something that would ADD the hours form your previous editing sessions and THIS session together.
These Two functions give hours from THIS session, all You have to do is summ it somehere to TOTAL HOURS?
This message was edited by ylijohe on 2002-09-19 01:05
 

Derek

Well-known Member
Joined
Feb 16, 2002
Messages
1,592
Hi Jay
You might like to try these two workbook event macros. They accummulate time the workbook has been open in A1 of Sheet1 (which you could hide then reference A1's value via a macro button and messagebox).
Custom Format A1 as [h]:mm:ss

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheet1.Range("A3").Value = Time
Sheet1.Range("A4").Value = Sheet1.Range("A3").Value - Sheet1.Range("A2").Value
Sheet1.Range("A1").Value = Sheet1.Range("A1").Value + Sheet1.Range("A4").Value
End Sub

Private Sub Workbook_Open()
Sheet1.Range("A2").Value = Time
End Sub

hope this gives you some ideas

regards
Derek

PS The first time you set this up you will need to close it, then reopen it again, then delete everything except the open time in cell A2. Thereafter it should work fine
This message was edited by Derek on 2002-09-19 01:15
 

Forum statistics

Threads
1,143,735
Messages
5,720,561
Members
422,291
Latest member
Deveshk

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top