ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do i check if the a named range is empty (https://www.excelbanter.com/excel-programming/438359-how-do-i-check-if-named-range-empty.html)

Luc[_8_]

How do i check if the a named range is empty
 
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


Bob Phillips[_4_]

How do i check if the a named range is empty
 

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

MsgBox "Is empty
End If

HTH

Bob

"Luc" wrote in message
...
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




Mike H

How do i check if the a named range is empty
 
Hi,

One way

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

Mike

"Luc" wrote:

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

.


Luc[_8_]

How do i check if the a named range is empty
 
Thanxxxx that did the job


If i hadn't you guys .....


Luc



"Mike H" schreef in bericht
...
Hi,

One way

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

Mike

"Luc" wrote:

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

.



All times are GMT +1. The time now is 10:11 AM.

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