Formula error when created via VBA

M

Max Woland

This is my issue: I was finally able to input a formula into sheets b
the range.formula property. The formula is properly displayed (it's
very easy "=SUM(C1;C10)") but returns an #ERROR. When I parse it throug
the Error's information menu, it says that it's SUM to cause th
problem. identical formula works fine when input manually, but the baut
is that if I copy from the sheet's correct formula and paste it into tn
range.formula property is stops working once pasted! :eek:(

the real cell content is as follows (soz, it's in italian)

=somma(C1:C9)

I couldn't find any trailing hidden characters.
Any idea?
Thank you for your time
 
C

Claus Busch

Ciao Max,

Am Mon, 7 Jan 2013 16:39:54 +0000 schrieb Max Woland:
This is my issue: I was finally able to input a formula into sheets by
the range.formula property. The formula is properly displayed (it's a
very easy "=SUM(C1;C10)") but returns an #ERROR.

VBA speaks english. If you want to sum C1:C10 then
[A1].Formula = "=Sum(C1:C10)"
IF you want to sum C1 and C10 then
[A2].Formula = "=Sum(C1,C10)"
If you want the italian formula then:
[A1].FormulaLocal = "=Somma(C1:C10)"


Regards
Claus Busch
 
W

witek

Max said:
This is my issue: I was finally able to input a formula into sheets by
the range.formula property. The formula is properly displayed (it's a
very easy "=SUM(C1;C10)")

; or : ?

but returns an #ERROR. When I parse it through
the Error's information menu, it says that it's SUM to cause the
problem. identical formula works fine when input manually, but the bauty
is that if I copy from the sheet's correct formula and paste it into tne
range.formula property is stops working once pasted! :eek:(

the real cell content is as follows (soz, it's in italian)

=somma(C1:C9)

I couldn't find any trailing hidden characters.
Any idea?
Thank you for your time!

type your formula manually, select that cell and in vbe in immediate
window display it.

? activecell.formula

then compare with formula in your code.


remember that .formula = .... accepts formulas in English only.
 

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