View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Lars-Åke Aspelin[_2_] Lars-Åke Aspelin[_2_] is offline
external usenet poster
 
Posts: 913
Default 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