G Guest Nov 16, 2006 #1 I am looking for code that would count all the negative numbers in a column and msgbox the results. Thanks, Aaron
I am looking for code that would count all the negative numbers in a column and msgbox the results. Thanks, Aaron
B Bob Phillips Nov 16, 2006 #2 Msgbox Application.COUNTIF(Range(A:A),"<0") -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct)
Msgbox Application.COUNTIF(Range(A:A),"<0") -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct)
G Guest Nov 16, 2006 #3 What if I wanted to count two different tabs and report both results in one msgbox?
G Guest Nov 16, 2006 #4 Something like this... MsgBox Application.CountIf(Sheets("Sheet1").Range("A:A"), "<0") + _ Application.CountIf(Sheets("Sheet2").Range("B:B"), "<0") or this... MsgBox Application.CountIf(Sheets("Sheet1").Range("A:A"), "<0") & vbcrlf & _ Application.CountIf(Sheets("Sheet2").Range("B:B"), "<0")
Something like this... MsgBox Application.CountIf(Sheets("Sheet1").Range("A:A"), "<0") + _ Application.CountIf(Sheets("Sheet2").Range("B:B"), "<0") or this... MsgBox Application.CountIf(Sheets("Sheet1").Range("A:A"), "<0") & vbcrlf & _ Application.CountIf(Sheets("Sheet2").Range("B:B"), "<0")