Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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" wrote in message
ups.com...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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" wrote in message
ups.com...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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" wrote in message
ups.com...
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!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
fixed decimal formatting moonshoe Excel Discussion (Misc queries) 2 January 23rd 09 10:54 PM
Decimal place formatting Big Ron Excel Discussion (Misc queries) 2 May 16th 07 07:57 PM
Formatting Decimal points sizemorem Excel Discussion (Misc queries) 2 September 30th 06 04:15 PM
European vs English Issue Bill[_30_] Excel Programming 4 February 8th 06 05:48 PM
formatting decimal points Sandra Chong Excel Programming 1 February 26th 04 04:52 PM


All times are GMT +1. The time now is 01:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"