I know how to do this in a worksheet:
=(b1-a1)*1440
B1 being the end time and A1 being the start time
I have a userform where the start time and end time are entered in text boxes
txtstart1 and txtend1
I would like the result to show up in txtmin1
Here is my code that doesnt work. I tried to convert code from a non-time sheet of mine. Dim as Integer may be the problem, I just learn as I go, and so far have only dealt with Integers.
Private Sub txtend1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim endnum1 As Integer, startnum1 As Integer
With frmquota
If txtend1.Value = "" Then
endnum1 = 0
Else
endnum1 = txtend1.Value
End If
If txtstart1.Value = "" Then
startnum1 = 0
Else
startnum1 = txtstart1.Value
End If
txtmin1.Value = endnum1 - startnum1 * 1440
End With
End Sub
Thank you for any help
Bookmarks