Private Sub TextBox1_Change()
If Len(TextBox1) = 2 Then TextBox1 = TextBox1 & ":"
calcul
End Sub
Private Sub TextBox2_Change()
If Len(TextBox2) = 2 Then TextBox2 = TextBox2 & ":"
calcul
End Sub
Sub calcul()
Dim x#, y#
TextBox3 = ""
If Not IsDate(TextBox1) Or Not IsDate(TextBox2) Then Exit Sub
x = CDbl(CDate(TextBox1))
y = CDbl(CDate(TextBox2))
If y > x Then
TextBox3 = Format(y - x, "hh:mm")
Else
TextBox3 = Format(1 - x + y, "hh:mm")
End If
End Sub