Hi All,
I'm struggling to get the excel timecode of a value I "receive" as a string, so I can make further manipulation of it.
The sting is in the format " 2016/12/02 23:24:30.67", where the leading character is a space and the seconds decimal is important.
Eliminating the leading space is no problem either with trim() or mid().
But when I try and get the datevalue() or timevalue() when including the seconds decimal, I get a runtime error: Type mismatch
ExpTrans is declared as double byte, TV1 as variant
I'm about to convert the seconds decimal to a timevalue as a separate operation and then add it to the date and time values to get the full value of the string.
But Is there any other better, or more efficient way?
Cheers,
mal
I'm struggling to get the excel timecode of a value I "receive" as a string, so I can make further manipulation of it.
The sting is in the format " 2016/12/02 23:24:30.67", where the leading character is a space and the seconds decimal is important.
Eliminating the leading space is no problem either with trim() or mid().
But when I try and get the datevalue() or timevalue() when including the seconds decimal, I get a runtime error: Type mismatch
Code:
TV1 = Mid(Cells(RowLoop, 4), 2, 22)
ExpTrans = TimeValue(TV1)
I'm about to convert the seconds decimal to a timevalue as a separate operation and then add it to the date and time values to get the full value of the string.
But Is there any other better, or more efficient way?
Cheers,
mal