Right click sheet tab>view code>copy/paste this>modify range(s) to suit
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo nomo
If Target.Count <> 1 Then Exit Sub
If Intersect(Target, Range("g:h")) Is Nothing _
Or Len(Application.Trim(Target)) < 1 _
Then Exit Sub
Application.EnableEvents = False
If Len(Target) = 3 Then
Target = Format(Left(Target, 1) & ":" & Right(Target, 2), "hh:mm")
Else
Target = Format(Left(Target, 2) & ":" & Right(Target, 2), "hh:mm")
End If
tr = Target.Row
If Cells(tr, "h") <> "" Then Cells(tr, "I") = _
(Cells(tr, "H") - Cells(tr, "g")) * 24
nomo:
Application.EnableEvents = True
End Sub
Sub fixit()
Application.EnableEvents = True
End Sub