+ Reply to Thread
Results 1 to 4 of 4

Getting decimal separator

  1. #1
    Registered User
    Join Date
    09-18-2003
    Location
    Denmark, Europe
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    5

    Getting decimal separator

    I am developing an Excel application to be used in European countries that use different decimal separators (comma or period) and different 1000 separators (period and comma). Therefore I need a system call from VBA that can tell me which decimal separator is actually used.

    In other words, how do I in VBA ask the system for the decimal separator?
    Helge V. Larsen

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Getting decimal separator

    See International Settings.

    Please Login or Register  to view this content.
    FWIW - remember also the likes of FormulaLocal / FormulaR1C1Local ...

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Getting decimal separator

    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  4. #4
    Registered User
    Join Date
    10-01-2008
    Location
    Piracicaba, SP
    Posts
    6

    Re: Getting decimal separator

    I've tested both the suggestions above with Excel 2003, on a computer with standard system settings for Brazil:

    Please Login or Register  to view this content.
    always returns the character in the textbox for Decimal separator of the International tab of the Options form (regardless of whether the box for use system separators is checked or not).

    Please Login or Register  to view this content.
    returns the system wide decimal separator.

    I have found this to be very important when working with code to modify formulas (range.formula), in which the decimal separator must always be ".", and not the system wide decimal separator. Here's some illustrative code:

    Please Login or Register  to view this content.

    With use system separators checked, and "." in the decimal separator box, I placed the value 2,36 ("," is my local system decimal separator) in cell D3, and the formula =D3*5,42 in cell E3. I then selected cell E3 and ran the macro above. Upon completion the contents of the cells were:

    HTML Code: 
    So for me:

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.


    Sincerely,

    Richard.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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