Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default DirectDependents not working properly.

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.

***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default DirectDependents not working properly.

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
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
formula not working properly nathanv3223 Excel Worksheet Functions 2 March 5th 09 02:16 PM
my sum function is not working properly rajnish Excel Discussion (Misc queries) 2 October 24th 07 02:29 PM
But not working properly Rao Ratan Singh Excel Discussion (Misc queries) 2 September 14th 06 08:45 AM
Finding when there are no directdependents [email protected] Excel Programming 1 June 19th 06 10:46 PM
For Each Loop not working properly oakman[_19_] Excel Programming 13 March 26th 06 11:44 PM


All times are GMT +1. The time now is 02:12 PM.

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

About Us

"It's about Microsoft Excel"