Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Pop-up calculator?

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Pop-up calculator?



--

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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Pop-up calculator?

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




  #4   Report Post  
Posted to microsoft.public.excel.programming
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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Pop-up calculator?

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)

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








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pop up calculator possible ? ORLANDO VAZQUEZ[_2_] Excel Discussion (Misc queries) 2 March 24th 09 08:31 PM
PMT calculator carrie08 Excel Discussion (Misc queries) 8 September 26th 08 07:16 PM
Calculator Word cat Excel Discussion (Misc queries) 4 August 29th 07 12:48 AM
Calculator Terry Excel Discussion (Misc queries) 12 October 7th 05 10:54 AM
calculator Colin2u Excel Discussion (Misc queries) 4 August 20th 05 02:08 PM


All times are GMT +1. The time now is 06:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"