Problem with formula in VBA

N

nagar

Hi,

I get an error when I put this line of code in VBA (I'm using th
Italian version of Excel).

I noticed that when I put more complex formulas I got errors.

Dim mystring as string
Dim firstfreepos as integer

mystring = "=SE(C" & firstFreePos & ";C" & firstFreePos & "-B"
firstFreePos & ";OGGI()-B" & firstFreePos & ") "
Range("D" & firstFreePos).Formula = (mystring)

I got no errors removing the '=' symbol from the beginning of th
formula.
If anyone can help me, it would really be appreciated.
Thanks.
Andre
 
S

Stephen Bullen

Hi nagar

Excel VBA is US-centric, so you need to either use the US-English version of
the formulas (including US separators), or use .FormulaLocal instead of
..Formula (which will only then work with Italian settings).

Regards

Stephen Bullen
 

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