+ Reply to Thread
Results 1 to 6 of 6

Periods versus comma's in VBA conditional formatting formulas

  1. #1
    Forum Contributor
    Join Date
    12-07-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2021
    Posts
    126

    Periods versus comma's in VBA conditional formatting formulas

    Hi,
    My Windows country settings use a comma for decimal separation and a period for thousand separation.

    When I use this code in VBA:
    Please Login or Register  to view this content.
    I use a period in VBA. In excel translates it as =0,9

    However, when I use this code:
    Please Login or Register  to view this content.
    I have to use a comma, or I will get a run-time error '5' : "Invalid procedure, call or argument"

    How can I make my workbook work in European AND US settings in Windows?

    Thanks for helping me out here...

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Periods versus comma's in VBA conditional formatting formulas

    There may be a better way to do this, but I tried this with with both US and Euro system settings and it seemed to work.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,535

    Re: Periods versus comma's in VBA conditional formatting formulas

    Just yesterday I came across this:
    Please Login or Register  to view this content.
    Would that work? I have not looked into it any further though.

  4. #4
    Forum Contributor
    Join Date
    12-07-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2021
    Posts
    126

    Re: Periods versus comma's in VBA conditional formatting formulas

    Thanks AlphaFrog,

    Your solution works perfectly!

  5. #5
    Forum Contributor
    Join Date
    12-07-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2021
    Posts
    126

    Re: Periods versus comma's in VBA conditional formatting formulas

    Thanks for your reply Jolivanes,
    FormulaLocal seems to work with normal formula's, but not with conditional formatting formulas.
    They seem to be quite unique...

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,535

    Re: Periods versus comma's in VBA conditional formatting formulas

    ArnolddG
    Thanks for the update.
    Like I mentioned, I had not used it but for me it is something to keep in mind for future use.
    Good luck.
    John

+ 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] Using Conditional Formatting with other formulas
    By billyshears in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-06-2013, 08:37 AM
  2. [SOLVED] Conditional Formatting versus macro code inthis example -stuck how to solve myself
    By leanne2011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2012, 08:11 PM
  3. [SOLVED] 3,000 Tables versus 3,000 Worksheets versus 3,000 Workbooks
    By StevenM in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-18-2012, 03:15 AM
  4. Excel 2011 - comma separators instead of periods
    By Sugarshakersar in forum Excel General
    Replies: 1
    Last Post: 06-07-2011, 12:11 AM
  5. Replies: 1
    Last Post: 09-14-2010, 03: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