Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default using countif function in code

How can I express this in VBA code:

countif(c:c,c2)

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's the vba code equivalent for Countif NDBC Excel Discussion (Misc queries) 3 July 4th 09 11:42 AM
Why does this COUNTIF code not work ChipButtyMan Excel Programming 5 October 20th 08 07:41 PM
How do I use a countif function according to two other countif fu. Kirsty Excel Worksheet Functions 2 February 20th 06 11:44 AM
Embed a countif function in subtotal function? Stuck at work Excel Worksheet Functions 1 February 14th 06 03:19 AM
doing COUNTIF() in code lothario[_74_] Excel Programming 2 January 26th 04 03:01 AM


All times are GMT +1. The time now is 02:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"