Closed Thread
Results 1 to 4 of 4

Decimal Formatting in Windows English vs European Formatting

  1. #1
    Drummer361
    Guest

    Decimal Formatting in Windows English vs European Formatting

    Hello,

    I am currently working on a project that is used in America, Europe,
    and South America, etc.

    I have a line of code that works and formats the ComboBox decimals
    properly in English, but when I change the Windows Language Options to
    German, Spanish, French, etc, (the decimal and periods are reversed) it
    gives me a VB Error on the line of code below:

    UserForm1.ComboBox1.Value = Format(UserForm1.ComboBox1.Value, "#0.000")

    The line of code above is used to format the ComboBox value on page
    entry. Does anybody have any idea why this won't work in European
    languages?


    Also, this line of code happens to work perfectly in all languages
    tested so far:

    For j = 12 To 23
    ComboBox1.AddItem Format((Worksheets("Worksheet1").Cells(j,
    11).Value), "#0.000")
    Next j

    This adds and formats the entries from the Cells to the ComboBox
    dropdown menu. It works fine in all languages.

    Your help and suggestions are appreciated!


  2. #2
    Norman Jones
    Guest

    Re: Decimal Formatting in Windows English vs European Formatting

    Hi Drummer,

    What error do you receive?

    If I used continental European settings, I had no problem with the
    indicated line of code.


    ---
    Regards,
    Norman



    "Drummer361" <[email protected]> wrote in message
    news:[email protected]...
    > Hello,
    >
    > I am currently working on a project that is used in America, Europe,
    > and South America, etc.
    >
    > I have a line of code that works and formats the ComboBox decimals
    > properly in English, but when I change the Windows Language Options to
    > German, Spanish, French, etc, (the decimal and periods are reversed) it
    > gives me a VB Error on the line of code below:
    >
    > UserForm1.ComboBox1.Value = Format(UserForm1.ComboBox1.Value, "#0.000")
    >
    > The line of code above is used to format the ComboBox value on page
    > entry. Does anybody have any idea why this won't work in European
    > languages?
    >
    >
    > Also, this line of code happens to work perfectly in all languages
    > tested so far:
    >
    > For j = 12 To 23
    > ComboBox1.AddItem Format((Worksheets("Worksheet1").Cells(j,
    > 11).Value), "#0.000")
    > Next j
    >
    > This adds and formats the entries from the Cells to the ComboBox
    > dropdown menu. It works fine in all languages.
    >
    > Your help and suggestions are appreciated!
    >




  3. #3
    Drummer361
    Guest

    Re: Decimal Formatting in Windows English vs European Formatting

    Hi Norman,

    The error I get is:

    Run-time error '380':
    Could not set the Value property. Invalid property value.

    Then I click "debug" and it sends me to the highlighted line of code
    above.


    Norman Jones wrote:
    > Hi Drummer,
    >
    > What error do you receive?
    >
    > If I used continental European settings, I had no problem with the
    > indicated line of code.
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    >
    > "Drummer361" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hello,
    > >
    > > I am currently working on a project that is used in America, Europe,
    > > and South America, etc.
    > >
    > > I have a line of code that works and formats the ComboBox decimals
    > > properly in English, but when I change the Windows Language Options to
    > > German, Spanish, French, etc, (the decimal and periods are reversed) it
    > > gives me a VB Error on the line of code below:
    > >
    > > UserForm1.ComboBox1.Value = Format(UserForm1.ComboBox1.Value, "#0.000")
    > >
    > > The line of code above is used to format the ComboBox value on page
    > > entry. Does anybody have any idea why this won't work in European
    > > languages?
    > >
    > >
    > > Also, this line of code happens to work perfectly in all languages
    > > tested so far:
    > >
    > > For j = 12 To 23
    > > ComboBox1.AddItem Format((Worksheets("Worksheet1").Cells(j,
    > > 11).Value), "#0.000")
    > > Next j
    > >
    > > This adds and formats the entries from the Cells to the ComboBox
    > > dropdown menu. It works fine in all languages.
    > >
    > > Your help and suggestions are appreciated!
    > >



  4. #4
    Drummer361
    Guest

    Re: Decimal Formatting in Windows English vs European Formatting

    Ah forget this issue I think I've created a larger monster. I'll post
    about it in a new topic.

    Drummer361 wrote:
    > Hi Norman,
    >
    > The error I get is:
    >
    > Run-time error '380':
    > Could not set the Value property. Invalid property value.
    >
    > Then I click "debug" and it sends me to the highlighted line of code
    > above.
    >
    >
    > Norman Jones wrote:
    > > Hi Drummer,
    > >
    > > What error do you receive?
    > >
    > > If I used continental European settings, I had no problem with the
    > > indicated line of code.
    > >
    > >
    > > ---
    > > Regards,
    > > Norman
    > >
    > >
    > >
    > > "Drummer361" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hello,
    > > >
    > > > I am currently working on a project that is used in America, Europe,
    > > > and South America, etc.
    > > >
    > > > I have a line of code that works and formats the ComboBox decimals
    > > > properly in English, but when I change the Windows Language Options to
    > > > German, Spanish, French, etc, (the decimal and periods are reversed) it
    > > > gives me a VB Error on the line of code below:
    > > >
    > > > UserForm1.ComboBox1.Value = Format(UserForm1.ComboBox1.Value, "#0.000")
    > > >
    > > > The line of code above is used to format the ComboBox value on page
    > > > entry. Does anybody have any idea why this won't work in European
    > > > languages?
    > > >
    > > >
    > > > Also, this line of code happens to work perfectly in all languages
    > > > tested so far:
    > > >
    > > > For j = 12 To 23
    > > > ComboBox1.AddItem Format((Worksheets("Worksheet1").Cells(j,
    > > > 11).Value), "#0.000")
    > > > Next j
    > > >
    > > > This adds and formats the entries from the Cells to the ComboBox
    > > > dropdown menu. It works fine in all languages.
    > > >
    > > > Your help and suggestions are appreciated!
    > > >



Closed 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