+ Reply to Thread
Results 1 to 7 of 7

User Form - Rounding and Time Formatting text boxes

  1. #1
    Registered User
    Join Date
    09-13-2023
    Location
    Adelaide, Australia
    MS-Off Ver
    Microsoft Office Home and Business 2019
    Posts
    11

    User Form - Rounding and Time Formatting text boxes

    Good morning,
    I have an excel spreadsheet for truck booking - and I have created a User Form for entering and adjusting the data. I have figured out how to get the data to populate from the row I selected but I am struggling with how to adjust my code when loading the data into the UserForm to get the TxtAvTime Text box to be formated as hh:mm as I have in the spreadsheet, and the txtLoadsCalc to have no decimal places.
    Hopefully this makes sense.

    Oread16=Picture1.jpg
    Attached Files Attached Files
    Last edited by 6StringJazzer; 09-20-2023 at 10:42 PM. Reason: added image from Word file inline

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: User Form - Rounding and Time Formatting text boxes

    For the time value update the code in your UserForm to this:

    Please Login or Register  to view this content.
    I'm unclear on the other field because you are already displaying it with no decimal places.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    09-13-2023
    Location
    Adelaide, Australia
    MS-Off Ver
    Microsoft Office Home and Business 2019
    Posts
    11

    Re: User Form - Rounding and Time Formatting text boxes

    Thank you for your quick response. That was probably not the best screen shot, as you are right it shows only the single digit - I have uploaded another one.

    Oread16=Picture2.jpg
    Attached Files Attached Files
    Last edited by 6StringJazzer; 09-21-2023 at 10:01 AM. Reason: put image inline

  4. #4
    Registered User
    Join Date
    09-13-2023
    Location
    Adelaide, Australia
    MS-Off Ver
    Microsoft Office Home and Business 2019
    Posts
    11

    Re: User Form - Rounding and Time Formatting text boxes

    That worked perfectly... and so simply.. Thank you

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: User Form - Rounding and Time Formatting text boxes

    Quote Originally Posted by Oread16 View Post
    I have uploaded another one.
    Please put your images inline right in your post rather than requiring people to download a file and then open it to see your screenshot.

    To attach an image, first click Go Advanced under your edit box. Then click in the text to set the cursor to where you want the image to appear, then press the image icon and attach your image.

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: User Form - Rounding and Time Formatting text boxes

    If you want to display it with no decimal places in the userform I would suggest you use integers in the data. You are formatting column O to display a rounded number even though the underlying value is not rounded. You should explicitly round it if that's what you need.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-13-2023
    Location
    Adelaide, Australia
    MS-Off Ver
    Microsoft Office Home and Business 2019
    Posts
    11

    Re: User Form - Rounding and Time Formatting text boxes

    Thank you for your guidance and the formula - I had not thought to do it that way.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. User Form - Many Text Boxes - Restrict One Text Box with Password for Editing
    By kavi.sundar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-06-2019, 07:42 PM
  2. [SOLVED] Concatenate user form text boxes values
    By bala04msw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-29-2018, 06:27 AM
  3. [SOLVED] User form: with check boxes how do i allow MULTIPLE auto filters to run at the same time
    By liamfrancis2013 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-04-2016, 09:13 AM
  4. Populate text boxes on user form, from combo box on same user form
    By Richardswaim in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 07-03-2016, 09:35 AM
  5. Data Validation between text boxes on user form
    By batmom2 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-05-2015, 03:33 PM
  6. Correct vba code for text boxes in user form
    By newqueen in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-27-2013, 09:38 PM
  7. [SOLVED] User form and text boxes on charts
    By Joel Mills in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2005, 06:05 PM

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