![]() |
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..... |
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..... |
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..... |
All times are GMT +1. The time now is 07:07 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com