Try
.FormulaLocal = "=SUBTOTALES(9," + elrango + ")"
>Note than I´m using a spanish edition of MS Excel. The name of the function is right in this version.
>
>In fact, the formula works great, but I get the error message until press F2 key to edit the cell, then enter; that´s the moment when the error message dissapear and shows the results.
>
>But the formula remains as I posted (I copied). Any idea?
--sb--