Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MsgBox answer format

Status
Not open for further replies.

newuser08

Technical User
Feb 12, 2008
29
GB
Hi All,

I’m putting together as seconds to minute’s converter and tried about 7 different variations that I’ve found (none of which seam to work for me).

So far I have a inputbox asking the use to enter the totals number of seconds on Enter a Msgbox to show the result in minutes.

Private Sub btnminutes_Click()
convertor = InputBox("Please enter the AHT in seconds...")
If convertor <> "" Then
Answer = convertor / 60
MsgBox "Total Minutes: " & Answer
End If
End Sub

I need my Answer shown in the Msgbox as 00:01:05 not 1.0833333

Any suggestions please.

Thanks
 
I need my Answer shown in the Msgbox as 00:01:05 not 1.0833333
Answer = Format(convertor / 86400, "hh:mm:ss")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Of course! Might have helped if I’d used total seconds in a day not just 60 DUH!

Thanks for showing me the error of my ways PHV
 
why do you need a seconds to minutes converter?

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
I'm with Geoff.

It sounds like you have someone keying in Average Handle Times, and you want the entry as minutes instead of seconds. A msgbox only tells them what to key - they still have to key it.

Every time you rely on a person to type in data, you introduce another opportunity for a mistake to be made.

If you must have someone enter in the data, then only make them do it once. The macro can convert it for them in the cell instead of just telling them what to type.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Every time you rely on a person to type in data, you introduce another opportunity for a mistake to be made. "

Crack me up anotherhiggins! True, very true, and the concept should be stamped in glowing letters on developers inner eyelids.

faq219-2884

Gerry
My paintings and sculpture
 
Hi Guys,

Your quite right it is for AHT’s and yes the way I started would have allowed additional user error.
I’ve since back tracked, now using a form to view the AHT’s converted to hh:mm:ss.

Thanks again for the assistance provided.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top