[vba]
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo Slut
Application.EnableEvents = False
If Not Intersect(Target, Range("TidCol")) Is Nothing Then
If IsNumeric(Target.Value) Then
If Target.Value Mod 1 = 0 And Target.Value > 0 Then
If Len(Target.Value) >= 3 And Len(Target.Value) <= 4 Then
iTime = Left(Format(Target, "0000"), 2)
iMinut = Right(Format(Target, "0000"), 2)
If iTime < 24 And iMinut <= 59 Then
Target = iTime / 24 + iMinut / 24 / 60
Else
Target = ""
End If
Target.NumberFormat = "[t]:mm"
Else
Target.Value = ""
End If
Else
Target.Value = ""
End If
Else
Target.Value = ""
End If
End If
Slut:
Application.EnableEvents = True
End Sub
[/vba]