Checking for empty cells in a range
If the cells are really empty--not formulas that evaluate to "":
dim myRng as range
set myrng = worksheets("sheet1").range("a7:A30")
if myrng.cells.count application.counta(myrng) then
'at least one empty
else
'all filled
end if
And if you want to include those formulas that evaluate to ""
(using Topper's suggestion)
dim myRng as range
set myrng = worksheets("sheet1").range("a7:A30")
if application.countblank(myrng) 0 then
'at least one empty
else
'all filled
end if
Chris Strug wrote:
Hi,
Probably a silly question but I'm not sure of the best way to achieve it.
Basically, given a range (say A7:A30) what's the best way to see if any of
these cells are empty / null / blank. I don't necessarily need to know which
ones simply that there is one or more blank cell present.
Any advice, links or any other help is gratefully received.
Thanks
Chris.
--
Dave Peterson
|