Format change with VBA language dependent?

  • Thread starter Thread starter tskogstrom
  • Start date Start date
T

tskogstrom

When I edit format by code, is that language dependent?

E.g.;

Range(rng).NumberFormat = "General"

"General" is a string and I guess it is called something else in other languages. At least in the user GUI's

But how is it with VBA? Will VBA use the "General" string and translate it into language specific values in the user GUI, or will the code error when a user with other language prefrerences uses it?

If you know this, tell me.

AND - if you in that case also know a good way to make the code language general, please do.


/Thanks a lot
 
If I understand you correct, the VBA code Range(rng).NumberFormat = "General" works in any language the GUIs have? Right?

Because I suppose [.NuberFormat = "General"] is different than the rest of the VBA code such as; [ .Borders(xlEdgeLeft) ]. The latter sentence clearly shows VBA is based on English, but neither "Borders" nor "EdgeLeft" are strings. My concern was the string "General" and fact it is the same expression in the GUI "General".

I did not quite follow you on your second remark about FormulaLocal, it sounds like the opposite to my needs, i want to have language independent code.. Soo, in that sense, I will run into trouble :-)

Regards
 
Hi,

Am Tue, 19 Nov 2013 13:30:27 -0800 (PST) schrieb tskogstrom:
If I understand you correct, the VBA code Range(rng).NumberFormat = "General" works in any language the GUIs have? Right?

yes, that is correct.
Because I suppose [.NuberFormat = "General"] is different than the rest of the VBA code such as; [ .Borders(xlEdgeLeft) ]. The latter sentence clearly shows VBA is based on English, but neither "Borders" nor "EdgeLeft" are strings. My concern was the string "General" and fact it is the same expression in the GUI "General".

Number formats are always in quote marks e.g. "m/d/yyyy" or "0.00"


Regards
Claus B.
 
So the general number format is always "General" in the user GUI, for your German GUI as well as it is in Chinese and all other languages? I didn't know that. And "m/d/yyyy" is the same in the user GUI in chinese etc too, even if it is based on the english expression "month", "day", "year"? You are sure?

Sorry if I make you answering same thing three times but I promise, after this I surely will belive you :-)

/Regards
 
Hi,

Am Tue, 19 Nov 2013 13:49:24 -0800 (PST) schrieb tskogstrom:
So the general number format is always "General" in the user GUI, for your German GUI as well as it is in Chinese and all other languages? I didn't know that. And "m/d/yyyy" is the same in the user GUI in chinese etc too, even if it is based on the english expression "month", "day", "year"? You are sure?

Sorry if I make you answering same thing three times but I promise, after this I surely will belive you :-)

yes I am sure. VBA is in all GUIs English. And when I create a date
format I have to use "m/d/yyyy"
The formats I posted in the answer before I have copied from my
VBA-Editor (Excel in German language version).
I have also to use the US standard delimiters. In my sheet I have a
comma as decimal separator but in VBA I have to use the dot.
VBA is international if you don't use Formula.Local


Regards
Claus B.
 
Back
Top