X
xlsxlsxls
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
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