31.10.2025, 15:38
Hi,
ein Vorschlag von mir:
ein Vorschlag von mir:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim loA As Long
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("F37,F43,C5:E35")) Is Nothing Then
If Target = "" Then Exit Sub
Application.EnableEvents = False
If Not IsNumeric(Target) Then
If Target.Column <> 3 Then
response = MsgBox("Eingabefehler! Nur Zahlen erlaubt!", vbOKOnly, "Achtung")
Target = ""
Else
Target = UCase(Target)
End If
Else
Target = CStr(Target)
loA = Len(Target)
Target = Left(Target, loA - 2) & ":" & Right(Target, 2)
Target.NumberFormat = "[h]:mm"
End If
Application.EnableEvents = True
End If
If Not Intersect(Target, Range("f44")) Is Nothing Then
Application.EnableEvents = False
If IsNumeric(Target) Then
Target = Left(Format(Target, "00000"), 3) & ":" & Right(Target, 2)
Target.NumberFormat = "[h]:mm"
End If
Application.EnableEvents = True
End If
End Sub
Gruß
Edgar
Edgar

wo liegt der Fehler

