+ Reply to Thread
Results 1 to 2 of 2

Formatting a Texbox to a decimal rounded to 1 number

  1. #1
    Forum Contributor
    Join Date
    11-08-2017
    Location
    London
    MS-Off Ver
    Office 2007
    Posts
    122

    Formatting a Texbox to a decimal rounded to 1 number

    In my sheet T2 I have a value 1.0 which must show 1.0 but for the life of me I dont know how to format it with the userform inniatilize with a textbox when the form load to show correctly. In Cell T3 I have 6.7 but it doesnt show 6.7 -think it needs to be rounded too as it show 6.6 .Both must be rounded to the next decimal. Rep given for some help please

    This is what I have at the form Initialize.....tried it but it also fails

    Textbox2.Value =Application.Round(Val(Textbox2.Value) /Range ("T1") , 1)
    Textbox1.Value =Application.Round(Val(Textbox1.Value) /Range ("T3") , 1)
    Last edited by JohnGreen2; 04-13-2018 at 08:09 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Formatting a Texbox to a decimal rounded to 1 number

    Moved to VBA section.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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. [SOLVED] Can't Compared Rounded numbers to 0 decimal places
    By forrestgump1980 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-04-2018, 08:57 AM
  2. [SOLVED] Formatting large number to display rounded $
    By brad_x81 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-26-2015, 08:01 AM
  3. syntax for comparing a rounded number to a rounded list
    By stockgoblin42 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-10-2013, 10:12 AM
  4. [SOLVED] showing message box if the result of texbox doesn't match with the range then clear texbox
    By hamidrezaxy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-20-2013, 01:04 PM
  5. [SOLVED] Conditional Formatting to Show whether the Displayed Number is Rounded
    By sskgintl in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-20-2013, 10:12 PM
  6. Replies: 3
    Last Post: 04-28-2011, 05:47 PM
  7. prices not rounded to 2 decimal points
    By philiasfogg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-05-2009, 11:57 AM

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