ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ComboBox List Formatting Issues in European Regions (https://www.excelbanter.com/excel-programming/369601-combobox-list-formatting-issues-european-regions.html)

Drummer361

ComboBox List Formatting Issues in European Regions
 
I have a strange issue with European Regional Language settings.

In Userform_Initialize() I define the list for the ComboBox with this
code:

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

I get a list that is properly formatted with 3 decimal places in both
English and European language settings.

When I change the value in the ComboBox, it changes the value perfectly
in English and the spreadsheet works great.

But when I change the same value in the ComboBox while in European
Regional Languages, it doesn't recognize the comma decimal seperator if
the value is 1 or greater.

Example:

I pick 0,500 from the list. The spreadsheet will change to 0,500.
I pick 1,500 from the list. The spreadsheet will change to 1 500.
I pick 4,500 from the list. The spreadsheet will change to 4 500.

Does anybody have any solutions or ideas as to why this might be
happening?


Drummer361

ComboBox List Formatting Issues in European Regions
 
I have done further investigation, and it appears that when I change my
Region to European language formatting, the ComboBox values are entered
into the Spreadsheet Cell as text and the European number formatting
does not apply.

I need to figure out a way to format the "text" as a number once it
reaches the active cell in the spreadsheet (from the Userform).

Does anybody have any experience with accomplishing this?

All help is greatly appreciated!



Drummer361 wrote:
I have a strange issue with European Regional Language settings.

In Userform_Initialize() I define the list for the ComboBox with this
code:

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

I get a list that is properly formatted with 3 decimal places in both
English and European language settings.

When I change the value in the ComboBox, it changes the value perfectly
in English and the spreadsheet works great.

But when I change the same value in the ComboBox while in European
Regional Languages, it doesn't recognize the comma decimal seperator if
the value is 1 or greater.

Example:

I pick 0,500 from the list. The spreadsheet will change to 0,500.
I pick 1,500 from the list. The spreadsheet will change to 1 500.
I pick 4,500 from the list. The spreadsheet will change to 4 500.

Does anybody have any solutions or ideas as to why this might be
happening?



Drummer361

ComboBox List Formatting Issues in European Regions
 
I think a solution might be to declare an "ActiveCell" function in the
ComboBox_Change() function that forces the string to be numeric when
loading it into the spreadsheet cell.

Does anybody know how to possibly write this line of code? I'm frying
my brain and am drawing a blank at the moment!!! :)


Drummer361 wrote:
I have done further investigation, and it appears that when I change my
Region to European language formatting, the ComboBox values are entered
into the Spreadsheet Cell as text and the European number formatting
does not apply.

I need to figure out a way to format the "text" as a number once it
reaches the active cell in the spreadsheet (from the Userform).

Does anybody have any experience with accomplishing this?

All help is greatly appreciated!



Drummer361 wrote:
I have a strange issue with European Regional Language settings.

In Userform_Initialize() I define the list for the ComboBox with this
code:

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

I get a list that is properly formatted with 3 decimal places in both
English and European language settings.

When I change the value in the ComboBox, it changes the value perfectly
in English and the spreadsheet works great.

But when I change the same value in the ComboBox while in European
Regional Languages, it doesn't recognize the comma decimal seperator if
the value is 1 or greater.

Example:

I pick 0,500 from the list. The spreadsheet will change to 0,500.
I pick 1,500 from the list. The spreadsheet will change to 1 500.
I pick 4,500 from the list. The spreadsheet will change to 4 500.

Does anybody have any solutions or ideas as to why this might be
happening?




All times are GMT +1. The time now is 03:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com