International macros in Excel

I am trying to create an international Excel macro. These macros should work in many countries.

I write formulas in english using Range.formula

but it doesn't work for all formulas (?)

For example, I am creating

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

      

In Spanish Excel, it works so that it is filled with " =SUMA(D7:D14)

". Right

Other formulas fail, 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 am with Excel 2010 and Windows 7 and I cannot figure out this strange behavior. Parameters are valid for all formulas

Any ideas?

+3


source to share


1 answer


Range.Formula

waiting for the notation of the English formula. This means not only English function names, but also the use of a comma to separate parameters, not a semicolon.

So

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



and

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

must work.

+3


source







All Articles