Hallo zusammen
Eine weitere Möglichkeit wäre die Verwendung von UDF (User Defined Function), d.h. eine xlsm-Datei mit Macro Ausführung.
Das sähe dann so aus:
Eingabemöglichkeiten:
Beliebige Kommastellen sowie Punkt oder Komma als Trennzeichen
=mytime("13:21:1") oder
=mytime("13:21:1,005") oder
=mytime("13:21:1.005")
Zellen-Format (hier für ms):
hh:mm:ss.000
UDF (unter Modul speichern!):
Public Function myTime(ByVal txt As String) As Variant
Dim tim As Date
Dim str As String
Dim frac As String
Dim pos As Long
On Error GoTo Err
'position Trennzeichen, Punkt oder Komma
pos = InStr(txt, ".")
If pos = 0 Then pos = InStr(txt, ",")
If pos > 0 Then
str = Left$(txt, pos - 1)
tim = TimeValue(str)
frac = Mid$(txt, pos + 1)
myTime = tim + Val(frac) / (10 ^ Len(frac)) / 86400#
Else
myTime = TimeValue(txt)
End If
Exit Function
Err:
myTime = txt 'no action oder alternativ CVErr(xlErrValue)
End Function