×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

working with time

working with time

working with time

(OP)
I am creating a user form that the user inputs a time value for meter distance and then is converted to time value for yard distance. The problem that I am having is that when I place the time in the "meters" text box  and then convert to "yards" it is not converting right. I am using only minutes and seconds and am not using any excel cells. Any ideas on how I can format these two text boxes to only minutes and seconds.
one last thing the "meter" text box is user input and the "yards" is VBA input.

Thanks for all of your help

RE: working with time

You may need to use IsDate to determine if the input string is a time value.  You may even need to add the "0:" in front to force it to recognize that there are zero hours.  Then, since it looks like you're performing some sort of unit conversion, you'll probably have to figure out the actual number of seconds rather than mixing minutes and seconds.  Use the TimeValue function to get the text box contents as a date data type.  Then use the Minute function on that to get the number of minutes, multiply by 60, and add that to the result of a Second function.  

There may be an easier way, but it's not coming to me right now.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources