Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Fabulous. I owe you lunch. Actually, I owe you about 20 lunches over the
years! MikeP "Tom Ogilvy" wrote in message ... the popular solution appears to be to use the Worksheetfunction Text var = Application.Text((Time2 - Time1), "[h]:mm:ss") demo'd from the immediate window Time1 = cdate("6/2/2006 4:04:00 PM") Time2 = cdate("6/5/2006 6:07:11 AM") var = Application.Text((Time2 - Time1), "[h]:mm:ss") ? var 62:03:11 -- Regards, Tom Ogilvy "Mike Proffit" wrote in message ... In VBA, I need to return the numbers of hours between 2 date/time values Dim Time1 as Date Dim Time2 as Date Time1 = "6/2/2006 4:04:00 PM" Time2 = "6/5/2006 6:07:11 AM" I want to return the number of hours, minutes, seconds between the date/times i.e. 62:03:11. using: var = Format((Time2 - Time1), "hh:mm:ss") returns only 14:03:11, ignoring the date difference. Thanks so much, Mike P |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Determining work hours between dates / hours | Excel Worksheet Functions | |||
Number of Hours&Minutes between Dates and time | Excel Discussion (Misc queries) | |||
wages - multiply hours and minutes by number of hours worked | Excel Discussion (Misc queries) | |||
Calculate number of hours between dates and times excluding Weekends | Excel Discussion (Misc queries) | |||
Calculate the number of hours between two dates and times | Excel Programming |