Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In my macro, I use the following code to return the total number of minutes
between 2 times: TtlMins = Day2 - Day1 TtlMins = 545 What I want to do next is to return the number of hours (9) and the remaining minutes (5) into 2 variables but I'm not having much luck MyHrs = ???? MyMins = ??? If I try TtlMins / 60 - I get 9.03338 when all I want is 9 and then I want to see 5 as the minutes left over Any help or code suggestions would be greatly appreciated. Thanks for the help -- JT |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
MyHrs = Int(TtlMins / 60)
MyMins = TtlMins - MyHrs * 60 HTH. Helmut. "JT" schrieb im Newsbeitrag ... In my macro, I use the following code to return the total number of minutes between 2 times: TtlMins = Day2 - Day1 TtlMins = 545 What I want to do next is to return the number of hours (9) and the remaining minutes (5) into 2 variables but I'm not having much luck MyHrs = ???? MyMins = ??? If I try TtlMins / 60 - I get 9.03338 when all I want is 9 and then I want to see 5 as the minutes left over Any help or code suggestions would be greatly appreciated. Thanks for the help -- JT |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this.
Code:
MyHrs = TtlMins \ 60 MyMins = TtlMins - MyHrs * 60 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Apr 28, 5:01*am, norie wrote:
Try this. Code:
MyHrs = TtlMins \ 60 MyMins = TtlMins - MyHrs * 60 Also can try following: MyHrs = TtlMins \ 60 MyMins = TtlMins mod 60 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Convert Decimal Minutes to Hours-Minutes-Seconds | Excel Programming | |||
Converting total minutes into hours and minutes in Excel | Excel Worksheet Functions | |||
converting Days Hours & minutes into just minutes in excel | Excel Discussion (Misc queries) | |||
how to change a decimal number (minutes) into hours and minutes? | Excel Discussion (Misc queries) | |||
add hours & minutes to other hours & minutes to receive total hou. | Excel Worksheet Functions |