+ Reply to Thread
Results 1 to 8 of 8

Excel International Decimal Separator.

  1. #1
    Registered User
    Join Date
    12-04-2006
    Posts
    11

    Excel International Decimal Separator.

    Hello, we need to deal with different International Decimal Separators all the time, US and Abroad. The US uses the traditional period ("."), while the abroad files uses comma (",").

    To change from one to another we go to Tools, Options, International and click or unclick the "Use the System Separator", while the decimal and thousands separators are already setup for the abroad system.

    The problem is that Excel does not save this information within the xls file. So, opening any xls file, no matter its requirement for decimal separator, Excel will always use the last setup, no matter if this setup is the one for that file or not.

    This cause a complete havok with our international and national documentation, since we always need to pay attention (and lots of it) if the separators are in accordance to the file being edited and printed. You can imagine how much printer paper we waste printing files with wrong separator setup.

    Any way to save the setup with the file, or include a macro or auto-script with the file that automatically change this setup when the file is loaded?

    Thanks for any help, we really appreciate it.

    Wagner
    Last edited by wagnerlip; 04-18-2011 at 01:01 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Excel International Decimal Separator.

    See if this works for you. Put it into the Thisworkbook module
    Please Login or Register  to view this content.
    Change your decimal and thousands separator as necessary. Did that work?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    12-04-2006
    Posts
    11

    Re: Excel International Decimal Separator.

    It works, I was reading the Excel Help and found that you can create a new macro that runs automatically when opening the file. The new macro must have the name "Auto_Open", and it works. I guess your Workbook_Open() will also works.

    Now, half the problem is solved. The other half is when I have two different workbooks open, one using "." as decimal, other requiring to use "," as decimal. I could solve this also using macros, but each macro in each workbook should auto-run when I select one or another file on desktop, something like "focus" in javascript. Is there a way to run a macro when the mouse focus a specific xls on desktop?

    Thank you.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Excel International Decimal Separator.

    If you go to the This Workbook module and change from "General" to "Workbook" the dropdown menu to the right will have the option of "Activate". Choose that and paste the guts of the previous subroutine into that one. You'll need to do that for all workbooks to change back and forth.

  5. #5
    Registered User
    Join Date
    12-04-2006
    Posts
    11

    Re: Excel International Decimal Separator.

    Sorry, you jump over me...

    Where is this "General" that I need to change to "Workbook" ?
    This Workbook module... what... where is it?

    Thanks.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Excel International Decimal Separator.

    Right click on a worksheet tab (i.e. sheet1) and "View Code" This opens up the VBA editor. On the left there should be a docked window with "Sheet1, sheet2, sheet3, This workbook.... Double click on this workbook. A new textbox opens on the right with two dropdowns saying "General" and "Declarations" Procede from there.

  7. #7
    Registered User
    Join Date
    12-04-2006
    Posts
    11

    Smile Re: Excel International Decimal Separator.

    Quote Originally Posted by ChemistB View Post
    Right click on a worksheet tab (i.e. sheet1) and "View Code" This opens up the VBA editor. On the left there should be a docked window with "Sheet1, sheet2, sheet3, This workbook.... Double click on this workbook. A new textbox opens on the right with two dropdowns saying "General" and "Declarations" Procede from there.
    Thank you very much.
    It solved my issue.

  8. #8
    Registered User
    Join Date
    09-12-2010
    Location
    ank
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Excel International Decimal Separator.

    Hi ChemistB. I realized that after closing the workbook, the system decimal settings change for other files also. Is there any way or any code to add so that the change will be only for the current workbook and system settings will not change for other files?

+ 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