ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   using countif function in code (https://www.excelbanter.com/excel-programming/439223-using-countif-function-code.html)

Bradly

using countif function in code
 
How can I express this in VBA code:

countif(c:c,c2)

Thanks.


Bob Phillips[_4_]

using countif function in code
 

MsgBox Application.COUNTIF(Columns("C"), Range("C2"))

HTH

Bob


"Bradly" wrote in message
...
How can I express this in VBA code:

countif(c:c,c2)

Thanks.




Lars-Åke Aspelin[_2_]

using countif function in code
 
On Thu, 4 Feb 2010 13:47:01 -0800, Bradly
wrote:

How can I express this in VBA code:

countif(c:c,c2)

Thanks.


Try something like this:

WorksheetFunction.CountIf(Sheets("Sheet1").Range(" C:C"),
Sheets("Sheet1").Range("C2"))

Hope this helps / Lars-Åke


All times are GMT +1. The time now is 08:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com