How do i check if the a named range is empty

L

Luc

I have a named range ("Risks").
How can i check if this named range contains no values.
If the range is totaly empty, then i have to show a message box and exit the
sub.


Thanxxxxx,

Luc
 
B

Bob Phillips

If Application.CountA(rng) = rng.Cells.Count Then

MsgBox "Is empty
End If

HTH

Bob
 
M

Mike H

Hi,

One way

If WorksheetFunction.CountA(Range("risks")) = 0 Then
MsgBox "Empty"
Else
MsgBox "Not Empty"
End If

Mike
 

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

Top