Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

working with time

Status
Not open for further replies.

jec3300

Automotive
Jan 30, 2006
55
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
 
Replies continue below

Recommended for you

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor