Gringoire
Board Regular
- Joined
- Nov 18, 2016
- Messages
- 71
- Office Version
- 365
- Platform
- Windows
Hi folks!
I'm just trying to write a formula in a cell.
if I use Formula2Local I got a '1004' Runtime error.
if I use FormulaLocal everything run smoothly
The runtime WatchWindow shows that Aggr_costi is a string: : Aggr_costi : "=AGGREGA(9;0;$L$48:$L$52)" : Variant/String :
and the aggregate interval is a Range: Worksheets("SK").Cells(ACT_row, Col_VAL) : Variant/Object/Range
I read this doc about formula and Formula2 and I can't understand why Formula2Local gives an error in this case.
I could go on and use FormulaLocal instead but:
- I prefer avoiding to do things without understanding why
- M$ suggest to use Formula2 as best practice
Could someone help me to understand why Formula2Local does not works in this case?
P.S: AGGREGA is the Italian formula for AGGREGATE. This is why I'm using Formula2Local and not Formula2
thanks
I'm just trying to write a formula in a cell.
if I use Formula2Local I got a '1004' Runtime error.
VBA Code:
Worksheets("SK").Cells(ACT_row, Col_VAL).Formula2Local = Aggr_costi
if I use FormulaLocal everything run smoothly
VBA Code:
Worksheets("SK").Cells(ACT_row, Col_VAL).FormulaLocal = Aggr_costi
The runtime WatchWindow shows that Aggr_costi is a string: : Aggr_costi : "=AGGREGA(9;0;$L$48:$L$52)" : Variant/String :
and the aggregate interval is a Range: Worksheets("SK").Cells(ACT_row, Col_VAL) : Variant/Object/Range
I read this doc about formula and Formula2 and I can't understand why Formula2Local gives an error in this case.
I could go on and use FormulaLocal instead but:
- I prefer avoiding to do things without understanding why
- M$ suggest to use Formula2 as best practice
Could someone help me to understand why Formula2Local does not works in this case?
P.S: AGGREGA is the Italian formula for AGGREGATE. This is why I'm using Formula2Local and not Formula2
thanks