» Calculations with one thousandth fractions of seconds by Custom Function using VBA
CATEGORY - Printing in VBA
VERSION - All Microsoft Excel Versions
are to be done
Answer: Insert the following code in the appropriate modules. With the following user defined function. syntax: =spectime(A1)
Place the code below into the standard module
Function SpecTime(txt As String)
Const DIV As Long = 86400
Dim dblValue As Double
dblValue = CInt(Right(txt, 4)) / (DIV * 10000)
dblValue = dblValue + CInt(Mid(txt, 4, 2)) / DIV
dblValue = dblValue + CInt(Left(txt, 2)) / (DIV / 60)
SpecTime= dblValue
End Function
Book Store:
No comments have been submitted.

