Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Countif using vba
Is it possible to write a "if command" which performs a countif 0 if a
certain criteria is meet. i.e r= 2 If cells (r,1) = "Marcus" and cells (r,2) = "Pink" then countif("A2:AB2"0) end if I have tried using the fucntion commande with little success I need to run this code through 10,000 record on a regural basis, it will alsways countif the same range, however the row will obviously change. Many thanks in anticipation Macus |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Countif using vba
Try: r= 2 If cells (r,1) = "Marcus" and cells (r,2) = "Pink" then Msgbox Application.CountIf(A2:AB2,"0") end i -- david ----------------------------------------------------------------------- davidm's Profile: http://www.excelforum.com/member.php...fo&userid=2064 View this thread: http://www.excelforum.com/showthread.php?threadid=38980 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Countif using vba
try this:
r = 2 If Cells(r, 1) = "Marcus" And Cells(r, 2) = "Pink" Then x = Application.CountIf(Range("A" & r & ":AB" & r), "0") MsgBox x End If Regards, KL "Mr M Walker" wrote in message ... Is it possible to write a "if command" which performs a countif 0 if a certain criteria is meet. i.e r= 2 If cells (r,1) = "Marcus" and cells (r,2) = "Pink" then countif("A2:AB2"0) end if I have tried using the fucntion commande with little success I need to run this code through 10,000 record on a regural basis, it will alsways countif the same range, however the row will obviously change. Many thanks in anticipation Macus |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Countif using vba
Dim r
r = 2 If Cells(r, 1) = "Marcus" And Cells(r, 2) = "Pink" Then MsgBox Application.CountIf(Range("A2:AB2"), "0") End If -- HTH RP (remove nothere from the email address if mailing direct) "Mr M Walker" wrote in message ... Is it possible to write a "if command" which performs a countif 0 if a certain criteria is meet. i.e r= 2 If cells (r,1) = "Marcus" and cells (r,2) = "Pink" then countif("A2:AB2"0) end if I have tried using the fucntion commande with little success I need to run this code through 10,000 record on a regural basis, it will alsways countif the same range, however the row will obviously change. Many thanks in anticipation Macus |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
countif | Excel Worksheet Functions | |||
How do I use a countif function according to two other countif fu. | Excel Worksheet Functions | |||
edit this =COUNTIF(A1:F16,"*1-2*")+COUNTIF(A1:F16,"*2-1*") | Excel Discussion (Misc queries) | |||
COUNTIF or not to COUNTIF on a range in another sheet | Excel Worksheet Functions | |||
COUNTIF in one colum then COUNTIF in another...??? | Excel Worksheet Functions |