Thread: vba for countif
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Shawn Shawn is offline
external usenet poster
 
Posts: 271
Default vba for countif

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))")

--
Thanks
Shawn


"Shawn" wrote:

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=M 1))

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.



--
Thanks
Shawn