Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Paste to next empty cell in named range of cells Sully Excel Discussion (Misc queries) 3 March 4th 10 05:23 PM
SUM() of empty dynamic named range returns #N/A Aviashn Excel Programming 2 June 2nd 08 08:52 PM
Trapping error from Empty Dynamic Named Range Casey[_105_] Excel Programming 5 June 13th 06 03:43 PM
Check for empty range in vba Phil Excel Discussion (Misc queries) 1 April 28th 06 09:57 PM
Named Range - Empty columns Tempy Excel Programming 8 July 8th 04 03:56 PM


All times are GMT +1. The time now is 09:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"