Real time stop watch that calculates individual costs by the minute.

hermithead

New Member
Joined
Sep 7, 2009
Messages
37
I have recently heard about this as a faciliation tool used at conferences to demonstrate to groups the real time costs of a discussion. The costs (which I assume are a fraction of the individuals hourly labour rate) increase at every minute mark of the conversation.

For example, at the 15th minute mark of a discussion that involves a group of 5 people with a hourly labour rate of $100 each the costs of that discussion in real time would display as $125; at the 16th minute mark ~$133; 17 mins ~$141 and so on.

The calculation is simple enough.

But how do you:
a) create a realtime stopwatch in excel?
b) at every minute mark trigger a calculation?

Im sure Im not the first to think of this.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Code:
Public stopMe As Boolean
Public resetMe As Boolean
Public myVal As Variant
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Target.Column = 1 Then
        If Target.Value = myVal And Target.Value <> "" Then
            'Changed
            Dim startTime, finishTime, totalTime, timeRow
            startTime = Timer
            stopMe = False
            resetMe = False
            myTime = Target.Offset(, 2).Value
            Target.Offset(, 1).Select
startMe:
            DoEvents
            timeRow = Target.Row
            finishTime = Timer
            totalTime = finishTime - startTime
            Target.Offset(, 1).Value = Format(myTime + totalTime, "0.0000") & " Seconds"
            If resetMe = True Then
                Target.Offset(, 1).Value = 0
                Target.Offset(, 2).Value = 0
                stopMe = True
            End If
            If Not stopMe = True Then
                Target.Offset(, 2).Value = totalTime
                GoTo startMe
            End If
            Cancel = True
            End
        Else
            'Not Changed
            stopMe = True
            Cancel = True
        End If
    End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    myVal = Target.Value
End Sub


I have found this code but the STOP START feature does not work as required - the timer does not restart from the time that you stopped at.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,272
Members
449,075
Latest member
staticfluids

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
Back
Top