+ Reply to Thread
Results 1 to 5 of 5

Unable to know which number format is used at data entry (e.g. European versus US)

  1. #1
    Registered User
    Join Date
    07-29-2013
    Location
    Amsterdam
    MS-Off Ver
    Excel 2008
    Posts
    3

    Unable to know which number format is used at data entry (e.g. European versus US)

    Hi there,
    I am new to VBA (using Mac) but developing a small application for use by people from different parts of the world.
    I require for instance the exchange rate for the local currency, using a textbox to capture the answer.
    I have declared the variable associated with the answer as Currency.

    Now comes my problem.
    I ask for the format [#,###.####]
    Some users however are used yo the European format of [#.###,####] so they accidentally use this.

    When I capture the answer in my sheet the result (in case of the European Answer ) to [1,3456] will be [13456] in stead of the expected [1,3456].
    If the input has only two digits behind the comma, there is no problem. This problem however occurs with three or more digits.
    Is there anyway to prevent this from happening?

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

    Re: Unable to know which number format is used at data entry (e.g. European versus US)

    When you capture number remove all . and , and after that format it as you like. Does that helps?

  3. #3
    Registered User
    Join Date
    07-29-2013
    Location
    Amsterdam
    MS-Off Ver
    Excel 2008
    Posts
    3

    Re: Unable to know which number format is used at data entry (e.g. European versus US)

    But if all . and , are removed, I don't know what the user would have meant.

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

    Re: Unable to know which number format is used at data entry (e.g. European versus US)

    you get 1.234,567
    Remove . you get 1234,567
    Substitute , with . you get 1234.567
    and now format it as number with #,###.####

  5. #5
    Registered User
    Join Date
    07-29-2013
    Location
    Amsterdam
    MS-Off Ver
    Excel 2008
    Posts
    3

    Re: Unable to know which number format is used at data entry (e.g. European versus US)

    Ok I know it is guessing, but if I get 1,234 and the mean 1234 (because they are used to US notation) and not 1.234?
    I understand that VBA expects US format. Is there a way to determine what the standard format is on a computer, e.g. ISO code or regional settings on the computer using the app?

+ 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. Date time format US/European format bug?
    By rbulph in forum Excel General
    Replies: 4
    Last Post: 04-22-2013, 11:45 AM
  2. [SOLVED] Convert European Number Formatting to USA Format
    By Mojave in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-02-2012, 05:53 PM
  3. European number format?
    By rafiki in forum Excel General
    Replies: 5
    Last Post: 04-18-2009, 05:04 AM
  4. Unable to format number in cells
    By Brunel in forum Excel General
    Replies: 3
    Last Post: 09-05-2007, 03:55 AM
  5. number of days between two dates in european format
    By manan in forum Excel General
    Replies: 3
    Last Post: 05-22-2006, 06:45 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