Pop-up calculator?

4

43fan

Not sure if I really have the subject proper or not. This is what I want to
do.

We have a spreadsheet that we keep individual workers times on. Every day,
we have to take their time sheet and figure the amount of time worked, then
enter it into the sheet. The times are truncated to the nearest 10th of a
minute.
IOW, 11:12 is 11.2 but so is 11:13 thru 11:17.

What I'd like to do is on a control key sequence, pop up a box to enter the
starting and ending time, then when <OK> is pressed or clicked, or when you
hit enter, have it calculate the time to the tenth, and insert it in
whatever field the cursor is in at that point.

Any help???

Thanks!!
Shawn
 
B

Bob Phillips

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
B

Bob Phillips

Shawn,

Not sure if I have got the rounding correct, but try this. It will change
the amount on input

Private Sub Worksheet_Change(ByVal Target As Range)
Dim nAmount As Double
On Error GoTo ws_exit:
Application.EnableEvents = False
With Target
nAmount = Int(.Value * 24) / 24 + _
Round((.Value * 24 - _
Int(.Value * 24)) * 6, 0) / 6 / 24
.Value = nAmount
End With

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
4

43fan

Bob,

Thanks! But, very much a beginner here, and, I'm not sure how to "run"
this...

Thanks again!
Shawn
 
B

Bob Phillips

Shawn,

The details on installing it were appended with the message. To run it, just
put a time in a cell, like 11:12, and watch it change.

You may want the changing cells to be limited to a certain range, if so post
back and I will; amend.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top