Array Formula in VBA

  • Thread starter Thread starter Michael168
  • Start date Start date
M

Michael168

Hi!VBA expert,

I need some help in coding the formula below.

I have the below code in a module. The first part is working for co
“L”.
result = 0
result = Application.WorksheetFunction.Sum(Range("A" & myRow, "J"
myRow))
Cells(myRow, 12).Value = result

In col “M” I like to add in the below formula, but don’t know how t
code it in VBA.

Array Formula = SUM(IF(A1:G1>=100,IF(A1:G1<=199.99,1,0)))

Can someone tell me how to do it?

Thanks,
Michae
 
If you want to count the number of cells that meet the 100 to 20
criteria,
=COUNTIF(A1:G1,">=100")-COUNTIF(A1:G1,">200")

If you want to add the numbers,
=SUMIF(A1:G1,">=100")-SUMIF(A1:G1,">200")

-gitcyphe
 
Back
Top