ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Custom NumberFormat - international version (https://www.excelbanter.com/excel-programming/420236-custom-numberformat-international-version.html)

snovik

Custom NumberFormat - international version
 
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?

Daniel.C[_2_]

Custom NumberFormat - international version
 
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?




snovik

Custom NumberFormat - international version
 
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" wrote:

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?





snovik

Custom NumberFormat - international version
 
this is where I got this string from and trying to use it via .COM

"Daniel.C" wrote:

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" wrote:

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?








All times are GMT +1. The time now is 04:30 PM.

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