vba for countif

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table of data in range A1:F10. In cell H1 I have the following
array formula: =SUM((A2:A10=J1)*(B2:B10=K1)*(C2:C10=L1)*(D2:F10=M1))

I don't want VBA that will put this formula into H1; rather, I want a VBA
that will make the Value of H1 equal to the result of a like VBA formula.
 
I seem to have figured it out:

Worksheets("Sheet1").Range("h2").Value = Evaluate("=SUMPRODUCT((A1:A10 =
J1)*(B1:B10=k1)*(C1:C10=L1)*(D1:F10=m1))")
 
dont use global(application) evaluate if you want your code
to work consistently (and independant of activesheet)

instead use worksheets("sheet1").evaluate




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Shawn wrote :
 
Back
Top