' ------------------------------------------------------------------------------ Private Function SecondsToWords(ByVal plngSeconds As Long) As String ' ------------------------------------------------------------------------------ ' converts a value in seconds to a description in days, hours, minutes and seconds Dim strTimeDesc As String Dim sglTemp As Single sglTemp = plngSeconds / SECONDS_IN_DAY sglTemp = Int(sglTemp) If sglTemp > 0 Then strTimeDesc = sglTemp & " day" If sglTemp > 1 Then strTimeDesc = strTimeDesc & "s" End If End If sglTemp = (plngSeconds Mod SECONDS_IN_DAY) / SECONDS_IN_HOUR sglTemp = Int(sglTemp) If sglTemp > 0 Then If strTimeDesc <> "" Then strTimeDesc = strTimeDesc & ", " End If strTimeDesc = strTimeDesc & sglTemp & " hour" If sglTemp > 1 Then strTimeDesc = strTimeDesc & "s" End If End If sglTemp = ((plngSeconds Mod SECONDS_IN_DAY) Mod SECONDS_IN_HOUR) / SECONDS_IN_MINUTE sglTemp = Int(sglTemp) If sglTemp > 0 Then If strTimeDesc <> "" Then strTimeDesc = strTimeDesc & ", " End If strTimeDesc = strTimeDesc & sglTemp & " minute" If sglTemp > 1 Then strTimeDesc = strTimeDesc & "s" End If End If sglTemp = plngSeconds Mod SECONDS_IN_MINUTE sglTemp = Int(sglTemp) If sglTemp > 0 Then If strTimeDesc <> "" Then strTimeDesc = strTimeDesc & ", " End If strTimeDesc = strTimeDesc & sglTemp & " second" If sglTemp > 1 Then strTimeDesc = strTimeDesc & "s" End If End If If plngSeconds = 0 Then strTimeDesc = "0 seconds" End If ' return the value SecondsToWords = strTimeDesc End Function