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.
 

Some videos you may like

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

hermithead

New Member
Joined
Sep 7, 2009
Messages
37
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,057
Messages
5,599,550
Members
414,316
Latest member
ExcelLee

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