PC Review


Reply
Thread Tools Rate Thread

DirectDependents not working properly.

 
 
baobob@my-deja.com
Guest
Posts: n/a
 
      2nd Feb 2008
I am having extreme difficulty determining if a cell has dependents:

Function CellA1HasDependents()
Dim R As Range
Set R = Range("MySheet!A1").DirectDependents
if R Is Nothing then
...

Whether another cell (on MySheet) refers to A1 or NOT, R is always Not
Nothing.

What am I doing wrong?

Thanks.

***
 
Reply With Quote
 
 
 
 
baobob@my-deja.com
Guest
Posts: n/a
 
      3rd Feb 2008
My difficulties and confusion increase, not decrease.

If A1 has 1+ dependents, then if in the VBE Immediate window I type
Range("MySheet!A1").DirectDependents.Count, I get a correct answer.

But:

1) If A1 has no dependents, then the expression throws an error (1004)
instead of answering "0". Why?

2) When the same expression is used in my FUNCTION, then, whether A1
has dependents or not, it a) always produces spurious value 1, and b)
never throws an error.

What is all this illogical behavior?

Thanks.

***
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem using DirectDependents Kevin Beckham Microsoft Excel Programming 6 16th Sep 2009 06:46 PM
What's the difference between .Dependents and .DirectDependents? baobob@my-deja.com Microsoft Excel Programming 4 3rd Feb 2008 03:27 AM
Finding when there are no directdependents sm34gm@gmail.com Microsoft Excel Programming 1 19th Jun 2006 10:46 PM
CTRL-F (Find) quit working after 6-months of working properly =?Utf-8?B?YmNyZWVu?= Microsoft Access Form Coding 0 31st May 2006 08:55 PM
XP NOT WORKING PROPERLY NO COLOUR NO SOUND NO DEVICES WORKING....M =?Utf-8?B?RG9v?= Windows XP General 1 5th Jan 2005 01:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:09 AM.