ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro that counts cells with a specific value (https://www.excelbanter.com/excel-programming/347631-re-macro-counts-cells-specific-value.html)

VILLABILLA[_4_]

Macro that counts cells with a specific value
 

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!


--
VILLABILLA


------------------------------------------------------------------------
VILLABILLA's Profile: http://www.excelforum.com/member.php...fo&userid=2242
View this thread: http://www.excelforum.com/showthread...hreadid=491406


Ron de Bruin

Macro that counts cells with a specific value
 
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"))

--
Regards Ron de Bruin
http://www.rondebruin.nl


"VILLABILLA" wrote in message
...

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!


--
VILLABILLA


------------------------------------------------------------------------
VILLABILLA's Profile: http://www.excelforum.com/member.php...fo&userid=2242
View this thread: http://www.excelforum.com/showthread...hreadid=491406





All times are GMT +1. The time now is 01:18 PM.

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