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


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 :

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