Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I try to use VBA code for calculation time:
If TimePerTask*NumberOfTask<23:59 then their is no problem. The problem occurs when TimePerTask*NumberOfTask24:00. I have tried different ways, but the answer is always the same. Ex:TimePerTask=1:00 * NumberOfTask=32 gives the result 8:00. The 24 hours is not showed, in the editor I can see the result 1989-12-31 08:00. What to do? Thanks in advance. Olle Humble |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
= 24*(SumProduct (timepertask, numberoftasks)). Format answer as number
Mike F "Olle Humble" wrote in message ... I try to use VBA code for calculation time: If TimePerTask*NumberOfTask<23:59 then their is no problem. The problem occurs when TimePerTask*NumberOfTask24:00. I have tried different ways, but the answer is always the same. Ex:TimePerTask=1:00 * NumberOfTask=32 gives the result 8:00. The 24 hours is not showed, in the editor I can see the result 1989-12-31 08:00. What to do? Thanks in advance. Olle Humble |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Olle,
I guess you variable is declared as date? Basically, don't worry about it, it is still holding 32 hours in the value. To prove this, format cell A1 on a worksheet as [hh]:mm. Then drop your variable in there Range("A1").Value = TimePerTask you will 32:00 in there. Basically, Excel/VBA holds time as a fraction of one day, so 32 hours = 1.3333333333 etc., and you can work with that happily. -- HTH RP (remove nothere from the email address if mailing direct) "Olle Humble" wrote in message ... I try to use VBA code for calculation time: If TimePerTask*NumberOfTask<23:59 then their is no problem. The problem occurs when TimePerTask*NumberOfTask24:00. I have tried different ways, but the answer is always the same. Ex:TimePerTask=1:00 * NumberOfTask=32 gives the result 8:00. The 24 hours is not showed, in the editor I can see the result 1989-12-31 08:00. What to do? Thanks in advance. Olle Humble |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
sumif and translate annual hours into weekly quarter hours | Excel Worksheet Functions | |||
Converting total number of hours (24 hours) into days | Excel Discussion (Misc queries) | |||
wages - multiply hours and minutes by number of hours worked | Excel Discussion (Misc queries) | |||
Drivers Hours Timesheet - Calculate Hours Worked on Weekly Basis | Excel Discussion (Misc queries) | |||
Convert hours and minutes in time format into fractions of hours.. | Excel Worksheet Functions |