+ Reply to Thread
Results 1 to 3 of 3

problem with input decimal numbers into a textbox

  1. #1
    Registered User
    Join Date
    12-03-2013
    Location
    Mestreech, Limburg
    MS-Off Ver
    Excel 2003
    Posts
    4

    problem with input decimal numbers into a textbox

    When i put decimal numbers into excelsheet de numpad . gives a ,
    But when i put a decimal number into a textbox on a userform de numpad . stays a . en the number is a integer.

    My settings are
    language: Dutch
    Keyboard: VS

    Why is the input different in excel then in VBA ?
    How do I have to configure VBA or userform so I can use de numpad . as a , ?
    Using Excel 2003

  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: problem with input decimal numbers into a textbox

    When inputting number into an Excel worksheet cell, Excel formats it as a number by default. However, when you type into a textbox, it is always considered to be text and will be exactly what you type. If you want "." to change to "," you can add code like this to the UserForm module. Change TextBox1 to your actual textbox name:
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: problem with input decimal numbers into a textbox

    Try this (didn't test it)

    Instead of Me.Textbox1.value use:
    Please Login or Register  to view this content.
    This will replace . with , if you use ,
    and remain . if user has other settings.

+ 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. Textbox to accept integers or decimal numbers only
    By Bob@Sun in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-23-2017, 03:51 AM
  2. Transfer data from userform to macro in a module, and textbox input as numbers?
    By flabb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-13-2016, 02:25 PM
  3. input the value of a Combobox and a textbox to a TEXTBOX directly from a userform
    By Gordonhk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-11-2013, 03:25 PM
  4. Use textbox input and VLookup to update another textbox on same userform
    By gcoug in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-22-2011, 10:39 AM
  5. VBA IF statement equaling numbers (decimal position rounding problem)
    By farzyness in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-10-2010, 03:41 PM
  6. Textbox decimal numbers
    By mqdias in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2007, 01:02 PM
  7. Textbox value decimal problem
    By mqdias in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2007, 09:30 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