Public Function FormatTime(ByVal lSeconds As Long) As String
Dim Days As Long
Dim Hours As Long
Dim Minutes As Long
Dim Seconds As Long
Dim tmp As String
ParseTime lSeconds, Days, Hours, Minutes, Seconds, True
If Days > 0 Then tmp = Days & " " & IIf(Days > 1, "Days", "Day")
If Hours > 0 Then tmp = tmp & _
IIf(Len(tmp) > 0, ", ", "") & Hours & " " & IIf(Hours > 1,
"Hours", "Hour")
If Minutes > 0 Then tmp = tmp & _
IIf(Len(tmp) > 0, ", ", "") & Minutes & " " & IIf(Minutes > 1,
"Minutes", "Minute")
If Seconds > 0 Then tmp = tmp & _
IIf(Len(tmp) > 0, ", ", "") & Seconds & " " & IIf(Seconds > 1,
"Seconds", "Second")
FormatTime = tmp
End Function
Sub test()
MsgBox FormatTime(123456789) ' Sekunden!!!
End Sub
---
Gruss
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
"Helmut Weber" <elmkqzn...@mailinator.com> schrieb im Newsbeitrag
news:r1tnk0hr53k67ihtu...@4ax.com...