Userform - Time input

H

Hennie Neuhoff

On a usefrorm the user must complete the time spent on various projects. The
input is formatted HH:MM. My problem is when the time is in excess of 24
hours, and the totalis more than 24 hours I can't get the correct nuber of
hours displayed.
Is there a way around this ?

Thanks in advance
 
G

Gary''s Student

Be sure you get the times in correctly. One way:

Sub marine()
Dim s As String
s = Application.InputBox(prompt:="enter time hh:mm:ss", Type:=2)
t = TimeValue(s)
MsgBox (t)
End Sub
 
R

RadarEye

On a usefrorm the user must complete the time spent on various projects. The
input is formatted HH:MM. My problem is when the time is in excess of 24
hours, and the totalis more than 24 hours I can't get the correct nuber of
hours displayed.
Is there a way around this ?

Thanks in advance

Hi Hennie

Try [HH]:MM as format.

HTH,
Wouter
 
R

Rick Rothstein

Where is it that you can't display the correct number of hours at? On a
worksheet? In a TextBox on the UserForm? Somewhere else?

Also, showing us the related code you have so far (working or not) would
help us to figure out exactly what you are attempting to do.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top