Checking for empty cells in a range

  • Thread starter Thread starter Chris Strug
  • Start date Start date
C

Chris Strug

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.
 
This formula says how many blank cells are there in you range:

=SUMPRODUCT(--(ISBLANK(A7:A30)))
 
Hi Toppers,

A potential problem with the use of the COUNTBLANK worksheet function is
that cells containining formulas which resolve to "" are treated as blank.
 
Hello,

Both formulas posted work great. The COUNTBLANK one is the simpliest
However, how do you add other ranges like C7:C30 to the formula wit
getting the too many arguments message?

=SUMPRODUCT(--(ISBLANK(A7:A30,C7:C30))) Doesn't work

=COUNTBLANK(a7:A30,C7:C30) Doesn't Work

Thanks,
EMo
 
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
 
Or just:

=SUMPRODUCT(--(ISBLANK(B7:C30)))

But I would think that the OP wanted a programming solution--since Chris posted
in .programming.
 

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