Custom NumberFormat - international version

S

snovik

I am trying to setup a custom NumberFormat in the way that could be used in
different regional settings. For example, I would like to have

"[Green]0,00_ ;[Red]-0,00"

applicable to US / DE / UK / RU / whatever else settings. Currently I get an
error when I try to move this code from one PC to another.

Is there a way to make NumberFormat culture independent?
 
S

snovik

yes, and I get the following message (I try to set it in the code, not UI)

Microsoft Office Excel cannot use the number format you typed.

Try using one of the built-in number formats. On the Format menu, click
Cells, and then click the Number tab. Select the category you want, and then
choose other options.


Daniel.C said:
You should try :
"[Green]0.00_ ;[Red]-0.00"
Regards.
Daniel
I am trying to setup a custom NumberFormat in the way that could be used in
different regional settings. For example, I would like to have

"[Green]0,00_ ;[Red]-0,00"

applicable to US / DE / UK / RU / whatever else settings. Currently I get an
error when I try to move this code from one PC to another.

Is there a way to make NumberFormat culture independent?
 
D

Daniel.C

Sorry. It works for me (french settings) :
Selection.NumberFormat = "[Green]0.00_ ;[Red]-0.00"
Daniel
yes, and I get the following message (I try to set it in the code, not UI)

Microsoft Office Excel cannot use the number format you typed.

Try using one of the built-in number formats. On the Format menu, click
Cells, and then click the Number tab. Select the category you want, and then
choose other options.


Daniel.C said:
You should try :
"[Green]0.00_ ;[Red]-0.00"
Regards.
Daniel
I am trying to setup a custom NumberFormat in the way that could be used in
different regional settings. For example, I would like to have

"[Green]0,00_ ;[Red]-0,00"

applicable to US / DE / UK / RU / whatever else settings. Currently I get
an error when I try to move this code from one PC to another.

Is there a way to make NumberFormat culture independent?
 
D

Daniel.C

Did you try to use the macro recorder ?
Daniel
yes, and I get the following message (I try to set it in the code, not UI)

Microsoft Office Excel cannot use the number format you typed.

Try using one of the built-in number formats. On the Format menu, click
Cells, and then click the Number tab. Select the category you want, and then
choose other options.


Daniel.C said:
You should try :
"[Green]0.00_ ;[Red]-0.00"
Regards.
Daniel
I am trying to setup a custom NumberFormat in the way that could be used in
different regional settings. For example, I would like to have

"[Green]0,00_ ;[Red]-0,00"

applicable to US / DE / UK / RU / whatever else settings. Currently I get
an error when I try to move this code from one PC to another.

Is there a way to make NumberFormat culture independent?
 
S

snovik

this is where I got this string from and trying to use it via .COM

Daniel.C said:
Did you try to use the macro recorder ?
Daniel
yes, and I get the following message (I try to set it in the code, not UI)

Microsoft Office Excel cannot use the number format you typed.

Try using one of the built-in number formats. On the Format menu, click
Cells, and then click the Number tab. Select the category you want, and then
choose other options.


Daniel.C said:
You should try :
"[Green]0.00_ ;[Red]-0.00"
Regards.
Daniel

I am trying to setup a custom NumberFormat in the way that could be used in
different regional settings. For example, I would like to have

"[Green]0,00_ ;[Red]-0,00"

applicable to US / DE / UK / RU / whatever else settings. Currently I get
an error when I try to move this code from one PC to another.

Is there a way to make NumberFormat culture independent?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top