+ Reply to Thread
Results 1 to 10 of 10

time calcutation in a userform

  1. #1
    Registered User
    Join Date
    11-17-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    18

    time calcutation in a userform

    I am trying to get brakes off time to be 6 minute before take off in the user form any ideas?
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: time calcutation in a userform

    Put this in the Userform code module. When the user exits the Take_off_inputBox, it test if its value is a valid time entry, then subtracts 6 minutes from it and put that earlier time in the brakes_off_TextBox.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-17-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    18

    Cool Re: time calcutation in a userform

    thats brilliant works perfect always find working with time in excel tricky
    now just got to reverse engineer it to add time in landing + 00:06 for brakes on
    thanks again
    Del.

  4. #4
    Registered User
    Join Date
    11-17-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: time calcutation in a userform

    just looking at the code above in the If statement, If Len(Take_off_inputBox) Then 'If not empty
    what is Len?

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: time calcutation in a userform

    In the VBA editor, highlight Len in the code and press F1.

  6. #6
    Registered User
    Join Date
    11-17-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: time calcutation in a userform

    yup thanks forgot you could do that

  7. #7
    Registered User
    Join Date
    11-17-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: time calcutation in a userform

    hello again still having a few probs with time in the above user form i have land_time and subtract Take_off the result at the moment is in hh:mm how can i convert it into a "0.0" format?

  8. #8
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: time calcutation in a userform

    Quote Originally Posted by Del117 View Post
    hello again still having a few probs with time in the above user form i have land_time and subtract Take_off the result at the moment is in hh:mm how can i convert it into a "0.0" format?
    By "0.0" do you mean decimal hours? If yes, multiply the result by 24 to convert it to decimal hours and display it with any decimal formatting you like.

    How Excel Stores Dates And Times

  9. #9
    Registered User
    Join Date
    11-17-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: time calcutation in a userform

    yes here is my attempt

    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    11-17-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: time calcutation in a userform

    I should add I have tried * the above code by 24
    have also tried
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1