Test For BLANK Range

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to write an IF>THEN>ELSE statement that will look at a range to
determine if it is blank or not. If it is blank I need to throw a messagebox.
If not, I need to continue.

My problem is that I can see how to do this with a formula in a sheet, but
don't want the results (or the formula for that matter) to appear on my
worksheet.

Any help is appreciated!

Thanks,
Ray
 
It depends on "how" blank:

Sub blanket()
MsgBox (Application.WorksheetFunction.CountA(Selection))
End Sub

will return zero if the cells Selected are empty. It will return 1 if one
of the cells contains something like:
=""
 
Try it on a fresh blank worksheet. It should give 0 for any Select'ed block
of cells
 

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