View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Trapping error from Empty Dynamic Named Range

The first check
if rng8 is nothing then
Checks to see if there was an actual range named FutureCatIIDB on that
worksheet. If that's something that could never happen, you can remove that
check.

The second check
if application.counta(rng8) = 0 then
checks to see if there is at least one cell in that range that isn't empty.

==
You may want to keep the first check--just in case someone deletes the name or
the range that the name refers to.

Casey wrote:

Dave,
Just what I needed, works exactly as I need it too when the Named range
is empty and just as I would expect it to when the Named range has data,
however I'm confused why there appears to be 2 checks on Rng8 to go
through. One if Rng8 is nothing and then one if CountA (Rng8) = 0.
Are they both necessary or were you just modeling my code so as not to
confuse my tired brain?
If they are necessary, could I ask you what part each test plays in
trapping potential errors.

--
Casey

------------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=551205


--

Dave Peterson