Hi all,
When I enter an array formula via vba, for example something like this,...:
... Excel seems to calculate each formula after inserting it. As you can see, the array formula checks 4 conditions from another sheet so it takes quite a long time when I have 6 similar formulas and MyVariable is 10. It takes about 45-60 seconds on my 2.2 x 2 processor. It even calculates the inserted formulas with the Application.Calculation method set to xlCalculationManual.
So my question is:
Is there a way to insert the formula without calculating it? I calculate the whole sheet by the Sheets("name").calculate method so calculating it beforehand is pointless.
I think about giving an apostrophe before each formula and then delete all apostrophes but something tells me it is a way around and there must be a better solutuion.</r[1]c[-2]),płatności!c[10]))"
PS. I'm sorry for breaking the code in two but the forum wouldn't show the entire code in one <code>.
</code></r[1]c[-2]),płatności!c[10]))"
When I enter an array formula via vba, for example something like this,...:
Code:
Range("C5").Select
For Count = 1 To MyVariable - 1
With ActiveCell
.FormulaArray = "=SUM(IF(((Płatności!C[-1])=R[" & -3 - Count & "]C[0])*((Płatności!C[1]) _
=""DokHandlowe"")*((Płatności!C[13])>=RC[-2])*((Płatności!C[13])<r[1]c[-2]),płatności!c[10]))"
Code:
.Offset(1, 0).Select
End With
Next Count<r[1]c[-2]),płatności!c[10]))"
... Excel seems to calculate each formula after inserting it. As you can see, the array formula checks 4 conditions from another sheet so it takes quite a long time when I have 6 similar formulas and MyVariable is 10. It takes about 45-60 seconds on my 2.2 x 2 processor. It even calculates the inserted formulas with the Application.Calculation method set to xlCalculationManual.
So my question is:
Is there a way to insert the formula without calculating it? I calculate the whole sheet by the Sheets("name").calculate method so calculating it beforehand is pointless.
I think about giving an apostrophe before each formula and then delete all apostrophes but something tells me it is a way around and there must be a better solutuion.</r[1]c[-2]),płatności!c[10]))"
PS. I'm sorry for breaking the code in two but the forum wouldn't show the entire code in one <code>.
</code></r[1]c[-2]),płatności!c[10]))"