AW: Einlesen von Zeiten ergibt Fehler
03.07.2018 02:23:06
Zeiten
Hallo Nepumuk,
Danke für Deine Hilfe, so funktioniert es.
Ich hätte da noch eine Frage, wie kann ich bewerkstelligen, dass vorab schon festgestellt wird ob es sich um eine Zeit formatierte Spalte, Standard oder Text handelt?
Private Sub CommandButton2_Click()
Dim obj As Object
On Error GoTo Fehler
For Each obj In Me.Controls
If obj.Tag "" Then
If ThisWorkbook.Worksheets("T05").Range(Mid(obj.Tag, 5, 2) & TextBox1.Value) = _
Format("hh:mm") Then
obj.Text = Format(ThisWorkbook.Worksheets("T05").Range(Mid(obj.Tag, 5, 2) & _
TextBox1.Value), "hh:mm")
Else
obj.Text = ThisWorkbook.Worksheets("T05").Range(Mid(obj.Tag, 5, 2) & TextBox1.Value)
End If
End If
Next
Exit Sub
Fehler:
MsgBox obj.Name & " " & ThisWorkbook.Worksheets("T05").Range(Mid(obj.Tag, 5, 2) _
& TextBox1.Value), vbCritical, "Laufzeitfehler"
End
End Sub
Danke.
Gruß
Ludmila