» Show the time in the Format hh:mm:000 using VBA
CATEGORY - Date & Time in VBA
VERSION - All Microsoft Excel Versions
Question: How can I show fractions of seconds in TimeFormat, so for example: 12:05:456?
Answer:
Enter the following Code with XL5/7 in an ModuleSheet, with XL8 in a general Module. InputSyntax: =milhours(A1)
Place the code below into the standard module
Function milHours(dteTime As Date)
Dim intSec As Integer
intSec = Second(dteTime)
intSec = intSec / 60 * 1000
milHours = Format(Hour(dteTime), "00") & ":" & _
Format(Minute(dteTime), "00") & "," & intSec
End Function
Book Store:
Recommended Books:
- How to Pay Zero Taxes (Annual)
- Financial Peace: Revisited
- Adventure Capitalist: The Ultimate Road Trip
- 422 Tax Deductions for Businesses and Self-Employed Individuals : You Get a Raise Every Time You Find a Legitimate Tax Deduction
- Word 2002: The Complete Reference
- Microsoft Word Version 2002 Step By Step (With CD-ROM)
No comments have been submitted.

