Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

International macros in Excel

I'm trying to create an international Excel macro sheet. These macros should work for many countries

I'm writing formulas in English using Range.formula, but it does not work for all formulas (?)

For example, I create

Range("D4").Formula = "=SUM(D7:D14)"

In Spanish Excel it works so is filled with "=SUMA(D7:D14)". Is correct

Other formulas fails, for example:

"=IF(R2=8;D7;D6)"                  'In Spanish Excel I get error 1004

"=ISNUMBER(O2)" works =ESNUMERO(O2)

"=PRODUCT(O2;O3)" Does not work,  error 1004  

I'm with Excel 2010 and Windows 7 , and I cannot understand this strange behavior. Parameters are valid for all formulas

Any ideas?

like image 902
Jam Avatar asked Feb 01 '26 18:02

Jam


1 Answers

Range.Formula expects English formula notation. This means not only English function names but also using comma to separate parameters and not semicolon.

So

...Formula = "=IF(R2=8,D7,D6)"

and

...Formula = "=PRODUCT(O2,O3)"

should work.

like image 149
Axel Richter Avatar answered Feb 04 '26 08:02

Axel Richter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!