Re: Entering Formula Programmatically in VBA

Tech-Archive recommends: Fix windows errors by optimizing your registry



try > outRange.Formula = tempArray



"MatthewS" <schaefer.mp@xxxxxxxxx> wrote in message
news:5e2fa131-5b67-4ef0-8228-594d2f461415@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm trying to put formulas into cells like this:


formulas(1) = "=Multiply(10,10)"
formulas(2) = "=Multiply(20,10)"

For i = 1 To 2
tempArray(i) = formulas(i)
Next i

outRange.Value = tempArray

This correctly puts the strings into the cells in the range, but they
are not evaluated. I have to select each cell in the *** and go into
the formula bar and hit enter so that they are evaluated. Then they
work fine.

How can I get these cells to evaluate from VBA? I've tried
outRange.Calculate and Application.CalculateFull, but they don't do
the trick.

Do I have the wrong approach to entering a formula in a cell
programmatically? How can this be done?

Thanks



--
Clif
Still learning Access 2003




.


Quantcast