Macro that counts cells with a specific value

  • Thread starter Thread starter VILLABILLA
  • Start date Start date
V

VILLABILLA

Hello,

I need a macro that counts the cells in a column that contain value
above 0.

The outcome of this count should then appear afterwards on certai
cell.

Ideas are very welcome!

Thanks in advance!

Robb
 
Thanks a lot for the proposed solution, it works.

However, what I overlooked is the fact that some of the numbers in
column that should be counted have the text format. Any way to count
the cells in a column that have a value(although text) except the blank
cells?

Thanks very much!
 
Application.CountIf(Range("D:D"), "<>0")
This will count all cells except the cells with 0

If you want to count all cells that are not blank use
MsgBox Application.CountA(Range("D:D"))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top