Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do I calculate the difference between 2 times. I have my code (I'm
beginner) so 1st input box asks for start time (e.g. 8:15) and 2nd inpu box asks for endtime (e.g. 11:00) which should place the result of 2.7 in the activecell. My code is set up as follows. Sub Timediff() Dim Starttime As String Dim Endtime As String Starttime = InputBox("Enter Start Time") Endtime = InputBox("enter Start Time") hours = TimeValue(Endtime) - TimeValue(Starttime) msgbox CInt(hours) ActiveCell.Value = hours End Sub ======================================= My goal is to eventually build this into a worksheet that performs a follows (using formulas) see attachment. Thanks in Advanc Attachment filename: time.xls Download attachment: http://www.excelforum.com/attachment.php?postid=65181 -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Difference Between Two Times | Excel Discussion (Misc queries) | |||
Difference between two times | Excel Discussion (Misc queries) | |||
Calculating difference between two times | Excel Worksheet Functions | |||
Difference in Times | Excel Discussion (Misc queries) | |||
Difference between 2 times and dates | Excel Worksheet Functions |