Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default working with rounded numbersnin a time sheet

I am working on a time card and what they want is a colum that shows vacation
time, sick time ect. No problem I have all that. But what they also want is
someone is gone for 1.5 hours it is to show as 2, but subtract as 1.5

Any ideas on this one?
Oh and the person I am doing this for, likes to "tweak it" after I have
worked on it. So I also need to make it tweak proof.....
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default working with rounded numbersnin a time sheet

You can set the NumberFormat of the range to "0" so it shows the rounded
value (as returned by .Text), but calculations will use the .Value (1.5).

Note however, that anyone looking at such a table may think it incorrect, as
the visible total may well not match any calculations.

Private Sub CommandButton2_Click()

With Range("A1")
.NumberFormat = "0"
.Value = 1.5
MsgBox .Value * 10
MsgBox .Text
End With

End Sub


NickHK

"
wrote in message ...
I am working on a time card and what they want is a colum that shows

vacation
time, sick time ect. No problem I have all that. But what they also want

is
someone is gone for 1.5 hours it is to show as 2, but subtract as 1.5

Any ideas on this one?
Oh and the person I am doing this for, likes to "tweak it" after I have
worked on it. So I also need to make it tweak proof.....



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default working with rounded numbersnin a time sheet

Thanks Nick! I am sure this will work, now if I can just figure out how to
program a little hand that will smack his when he tries to change the rest of
the formula's around.................. :)

"NickHK" wrote:

You can set the NumberFormat of the range to "0" so it shows the rounded
value (as returned by .Text), but calculations will use the .Value (1.5).

Note however, that anyone looking at such a table may think it incorrect, as
the visible total may well not match any calculations.

Private Sub CommandButton2_Click()

With Range("A1")
.NumberFormat = "0"
.Value = 1.5
MsgBox .Value * 10
MsgBox .Text
End With

End Sub


NickHK

"
wrote in message ...
I am working on a time card and what they want is a colum that shows

vacation
time, sick time ect. No problem I have all that. But what they also want

is
someone is gone for 1.5 hours it is to show as 2, but subtract as 1.5

Any ideas on this one?
Oh and the person I am doing this for, likes to "tweak it" after I have
worked on it. So I also need to make it tweak proof.....




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
add rounded numbers using the rounded value Ruth Excel Discussion (Misc queries) 2 February 8th 10 07:59 PM
Rounded Corners in Excel 2007 Not Working?!?! Kulprit Charts and Charting in Excel 7 April 14th 08 08:18 AM
Timesheet Calculation with Time Rounded Bee Excel Discussion (Misc queries) 9 March 5th 08 04:35 PM
Using rounded time with vlookup Zug Excel Discussion (Misc queries) 3 April 30th 06 01:59 AM
Cell contents with custom time format rounded after double-click HumblePie Excel Discussion (Misc queries) 2 August 6th 05 08:07 PM


All times are GMT +1. The time now is 11:09 AM.

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

About Us

"It's about Microsoft Excel"