+ Reply to Thread
Results 1 to 7 of 7

Text box display with 2 decimal point.

  1. #1
    Forum Contributor
    Join Date
    12-21-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    387

    Text box display with 2 decimal point.

    Hello every one,

    I have a text box on a userform.

    The text box is populated with a number which is generated by a figure which is in column "E" in 2 decimal point.

    but the result in a text box can't show decimal point.

    Ex. in "E5" has figure 60000.00 but in text box it's display 60000
    in "E6" has figure 12500.00 but in text box it's display 12500

    Is it possible to make the "result" in text box whole number with 2 decimal point?

    The text box is named "txtfdamount".

    Thanks.
    My English is very poor, so please be patient >_<"

    Thanks & Regards.
    hkbhansali

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Text box display with 2 decimal point.

    Hi,

    How is the textbox actually populated? Is it linked to the cell or done through code?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Contributor frabulator's Avatar
    Join Date
    09-16-2015
    Location
    United States
    MS-Off Ver
    2019
    Posts
    101

    Re: Text box display with 2 decimal point.

    What if you set the textbox.text to "= Cstr(Sheet(1).Cells(2,5).Text)", does this solve your issue?

    HTML Code: 
    What should happen (not tested) is the cell value will be converted to text and therefor not rounded like it would be if it were a integer or double.


    *--EDIT--*
    I just tested my code and I was incorrect :P

    Kasan has the correct answer
    Last edited by frabulator; 01-17-2017 at 10:43 AM.

  4. #4
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: Text box display with 2 decimal point.

    You need to format value of textbox:
    Please Login or Register  to view this content.
    where 'YourValue' is value you need to populate.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Text box display with 2 decimal point.

    Rather than use the Control Source property of the textbox - which I assume is the case, use the UserForm Initialise event

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  6. #6
    Forum Contributor
    Join Date
    12-21-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    387
    Quote Originally Posted by xlnitwit View Post
    Hi,

    How is the textbox actually populated? Is it linked to the cell or done through code?
    Done through code

  7. #7
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Text box display with 2 decimal point.

    Then I believe you already have several working answers.

+ 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. Replies: 4
    Last Post: 04-19-2016, 05:19 PM
  2. Replies: 2
    Last Post: 01-18-2012, 03:54 PM
  3. Display only the number from left of decimal point.
    By arthurz11 in forum Excel General
    Replies: 9
    Last Post: 10-29-2011, 03:20 AM
  4. Format display decimal values but no decimal point
    By BecParko in forum Excel General
    Replies: 1
    Last Post: 10-18-2007, 04:42 AM
  5. Replies: 3
    Last Post: 03-18-2006, 02:25 PM
  6. [SOLVED] Display a digit before or after the decimal point in another cell
    By Robert Monks in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-03-2005, 05:25 AM
  7. [SOLVED] FIXED 2 DECIMAL PLACES, MUST ENTER ALL ZEROES AFTER DECIMAL POINT.
    By SUKYKITTY in forum Excel General
    Replies: 3
    Last Post: 07-06-2005, 09:05 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