View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
43fan 43fan is offline
external usenet poster
 
Posts: 32
Default Pop-up calculator?

Bob,

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

Thanks again!
Shawn

"Bob Phillips" wrote in message
...
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)

"43fan" wrote in message
...
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