PC Review


Reply
Thread Tools Rate Thread

Dependents problem

 
 
Bony Pony
Guest
Posts: n/a
 
      10th Mar 2010
Hi all,
I have an input cell that is data validated. It is the only cell currently
selected.

In VBA immediate (or in a module) if I check for

?selection.dependents.count it tells me the (1004) No cells were found.

yet when I enter selection.showdependents it shows the dependency "button"
and arrow.

If I look at selection in the watch window,
Dependents - (No cells were found)
Directdependents - (No cells were found)

Please can anybody shed some light on this?

Kind regards,
Bony


--
"There are 10 types of people in this world. Those who understand Binary
and those who don''t ..."
 
Reply With Quote
 
 
 
 
Bony Pony
Guest
Posts: n/a
 
      10th Mar 2010
OMG! A reply from the co-author of namemanager!! What a brilliant piece of
work that is.

Thanks for the reply Jan Karel.

Is there a way to "know" a cell's dependents?

Thanks again!

Kind regards,
Bony

--
"There are 10 types of people in this world. Those who understand Binary
and those who don''t ..."


"Jan Karel Pieterse" wrote:

> Hi Bony,
>
> > yet when I enter selection.showdependents it shows the dependency "button"
> > and arrow.
> >
> > If I look at selection in the watch window,
> > Dependents - (No cells were found)
> > Directdependents - (No cells were found)
> >
> > Please can anybody shed some light on this?

>
> The Dependents collection only shows dependents on the same worksheet. The
> ShowDependents method shows the arrows pointing to other worksheets too.
>
> Regards,
>
> Jan Karel Pieterse
> Excel MVP
> http://www.jkp-ads.com
>
> .
>

 
Reply With Quote
 
Bony Pony
Guest
Posts: n/a
 
      10th Mar 2010
Jan Karel many thanks again!

Actually the clue in your code was the activesheet.shapes.count

Simply - if the activesheet.shapes.count didn't change then there are no
dependents / precedents. Sometimes these answers are SO obvious!

Many thanks again.

Kind regards,
Bony
--
"There are 10 types of people in this world. Those who understand Binary
and those who don''t ..."


"Jan Karel Pieterse" wrote:

> Hi Bony,
>
> > OMG! A reply from the co-author of namemanager!! What a brilliant piece of
> > work that is.

>
> :-))
>
> > Is there a way to "know" a cell's dependents?

>
> You can use the navigateArrow method to find them out. Code like this:
>
> Sub Demo2()
> Dim oRng As Range
> Dim sForm As String
> Dim lLink As Long
> Dim lArrow As Long
> sForm = ActiveCell.Formula & vbNewLine
> Set oRng = ActiveCell
> oRng.ShowPrecedents
> On Error Resume Next
> For lArrow = 1 To ActiveSheet.Shapes.Count
> For lLink = 1 To 1000
> Err.Clear
> Application.Goto oRng
> oRng.NavigateArrow True, lArrow, lLink
> If Err.Number = 0 And oRng.Address(external:=True) <>
> Selection.Address(external:=True) Then
> If oRng.Parent.Name = ActiveCell.Parent.Name Then
> sForm = sForm & vbNewLine & Selection.Address(False, False,
> , False)
> Else
> sForm = sForm & vbNewLine & Selection.Address(False, False,
> , True)
> End If
> Else
> Exit For
> End If
> Next
> Next
> MsgBox sForm
> End Sub
>
> My ReftreeAnalyser (not free, but there is a free demo) does a decent job at
> finding them:
>
> www.jkp-ads.com/reftreeanalyser.asp
>
> Regards,
>
> Jan Karel Pieterse
> Excel MVP
> http://www.jkp-ads.com
>
> .
>

 
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
UDF FOR DEPENDENTS Faraz A. Qureshi Microsoft Excel Misc 0 26th Jun 2009 05:02 AM
dependents problem =?Utf-8?B?RGF2ZQ==?= Microsoft Excel Crashes 0 6th Feb 2006 09:35 PM
Trace Dependents Problem Brian Microsoft Excel Programming 0 27th Jan 2006 12:43 AM
Trace Dependents Problem brian.ct.ho@gmail.com Microsoft Excel Programming 0 26th Jan 2006 11:50 PM
Dependents =?Utf-8?B?a3Q=?= Microsoft Excel Programming 1 11th Jun 2005 03:10 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:26 PM.