Hi everyone,
I'm trying to enter a long array formula through VBA, by using the method posted here
I'm struggling though, can't find a way to make it work. If there's another way around it, I'm completely open.
Code is:
Thanks!!
I'm trying to enter a long array formula through VBA, by using the method posted here
I'm struggling though, can't find a way to make it work. If there's another way around it, I'm completely open.
Code is:
Code:
Sub Array_Formula()
Dim FormulaPart1 As String
Dim FormulaPart2 As String
FormulaPart1 = "=SUM(COUNTIFS(Master!$A1:$A100,IF(Control!$A$8=""(All)"",""*?"",Control!$A$8),Master!$B1:$B100,Control!$B$32:$B$43," & _
"Master!$C1:$C100,IF(Control!$C$8=""(All)"",""*?"",Control!$C$8),YYYY))"
FormulaPart2 = "Master!$D1:$D100,IF(Control!$D$8=""(All)"",""*?"",Control!$D$8),Master!$E1:$E100,IF(Control!$E$8=""(All)"",""*?"",Control!$E$8)" & _
",Master!$F1:$F100,IF(Control!$F$8=""(All)"",""*?"",Control!$F$8),Master!I1:I100,Control!$A55"
With Sheet1.Range("C66")
.FormulaArray = FormulaPart1
.Replace "YYYY", FormulaPart2, lookat:=xlPart
End With
End Sub
Thanks!!