Gibt es ein Format , damit ich in eine Zelle z.B. 1234 schreibe und 12:34 Uhr erhalte.
Damit ich mir den Doppelpunkt erspare und am Ziffernblock bleiben kann?
mfG
Herbert
Private Sub Worksheet_Change(ByVal Target As Range)'in das jeweilige blatt kopieren
Dim intSec As Integer, intMin As Integer, intHour As Integer
Dim txt As String, formel As String
If Target.Column < 1 Then Exit Sub
If IsEmpty(Target) Or Selection.Cells.Count > 1 Then Exit Sub
If Target.Row < 1 Then Exit Sub
txt = CStr(Target.Value)
Select Case Len(txt)
Case 3: txt = "0" & txt & "00"
Case 4: txt = txt & "00"
Case 5: txt = "0" & txt
End Select
txt = Left(txt, 2) & ":" & Mid(txt, 3, 2) & ":" & Right(txt, 2)
On Error GoTo ERRORHANDLER
Application.EnableEvents = False
Target.Value = TimeValue(txt)
Application.EnableEvents = True
Exit Sub
ERRORHANDLER:
Application.EnableEvents = True
End Sub