View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
mangesh_yadav[_179_] mangesh_yadav[_179_] is offline
external usenet poster
 
Posts: 1
Default Time calculations in VBA


Mahesh,

what you are currently doing is that you are converting the result to a
string by using TEXT. Now coming to your main problem of depicting 1:30
as 1.5. Date/Time is represented in excel using numbers and 1 day is
equivalent to 1 unit. As you see the base is DAY. Now sinve you want
the base as HOUR, you can simply multiply your result by 24. This will
give you the required 1.5 instead of 1:30. Also remember to format this
as a number and not date/time.


--
mangesh_yadav


------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=276891