+ Reply to Thread
Results 1 to 5 of 5

trying to format userform text box to numbers

  1. #1
    Registered User
    Join Date
    09-27-2012
    Location
    Peoria,Il USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    trying to format userform text box to numbers

    I have an excel sheet with variables and i am trying to call the variable into the form keeping the format.

    current format is #,##0.00 for dolor amounts
    and 0.##% for percents

    here are two things that i have tried to get the percent to work

    Please Login or Register  to view this content.
    CR stands for current row
    NR next row

    As you can see when i call the value i call it as an integer hopping to keep it as a number. it always seems to change to a text string.

    thanks

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: trying to format userform text box to numbers

    Hello Neisany,

    Don't use the Range property Value. Instead use the Range property Text. This returns the formatted version of the actual value.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    09-27-2012
    Location
    Peoria,Il USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: trying to format userform text box to numbers

    When i try the above code
    Please Login or Register  to view this content.
    I am still getting state = "8.5%"

    and when i push that out to a cell
    Please Login or Register  to view this content.
    it is being placed as a text value not a number.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: trying to format userform text box to numbers

    Maybe play with values:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-27-2012
    Location
    Peoria,Il USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: trying to format userform text box to numbers

    you guys are awesome.
    the trick that i found was to make sure to set the
    Please Login or Register  to view this content.
    then it kept it as a number.
    Thank you so much I will mark this as answered.

+ 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] make Userform entries with just numbers stay as text and not numbers upon pasting
    By vpan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-01-2016, 02:13 PM
  2. [SOLVED] Change imported numbers in text format to numbers
    By navialivad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2014, 02:30 PM
  3. UserForm Textbox Format With Capital Letters and Numbers
    By saucey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-22-2012, 11:38 AM
  4. Changing numbers from text format to number format
    By garden_gnome in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-09-2012, 12:48 PM
  5. Use spreadsheet cell format to set userform text box format - how?
    By barryleajo in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-08-2010, 07:17 AM
  6. Convert numbers from text format to number format
    By merlin68 in forum Excel General
    Replies: 4
    Last Post: 04-12-2005, 09:06 AM
  7. How can you format numbers that are loaded into fields of a userform?
    By PropKid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-20-2005, 09:33 AM

Tags for this Thread

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