ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   check if range containing values (https://www.excelbanter.com/excel-programming/271567-check-if-range-containing-values.html)

Markus Serbel

check if range containing values
 
hi,

how can I check, if a cell range ( range("A1", "A5") ) contains any values?
i need to know, if the cells are empty.

thanks,
markus


Markus Serbel

check if range containing values
 
J.E. McGimpsey wrote:
Dim numVals As Integer
numVals = Application.CountA(Range("A1:A5"))
If numVals = 0 Then MsgBox "All Empty"


thank you! :)
markus

Markus Serbel

check if range containing values
 
Pieter Kuyck wrote:
WorksheetFunction.CountA(Range("A1:A5"))=0



thank you! :)
markus


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

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