Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / June 2005

Tip: Looking for answers? Try searching our database.

Getting grip on dependents

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tondewilde - 01 Jun 2005 10:05 GMT
Hi,
In my spreadsheet ther is a field that has a dependent in an other
worksheet.
How can I find that.
the VB property 'dependents' will only return dependents on the same
worksheet.

best rgds,
Ton
Robin Hammond - 01 Jun 2005 13:10 GMT
Ton,

It's a nasty one. A small extract of a much much bigger routine kludged
quickly purely to demonstrate how to test it. Might be bugs in this, since I
haven't tried doing anything with it.

'you would probably set up some kind of loop here but for the time being
Set rngTestCell = cells(1,1)

'use the showdependents method then try and navigate along the arrows
rngTestCell.ShowDependents
On Error GoTo 0
nLinkNumber = 1
Do
   On Error GoTo NoMoreLinks
   rngTestCell.NavigateArrow TowardPrecedent:=False, ArrowNumber:=1,
LinkNumber:=nLinkNumber
   On Error Goto 0

   'writing this as I go in this message
   if not activecell.parent is rngTestCell.Parent then
       msgbox activecell.parent.name & " " & activecell.address

       'you would probably reselect the original sheet here, e.g.
       rngTestCell.Parent.Select

   End If
   nLinkNumber = nLinkNumber +1
Loop

Exit Sub
NoMoreLinks:
'if you got here the cell doesn't have an external dependent
'resume somewhere back in your code
End Sub

I've pushed all this to the limit in my XspandXL add-in on my site if you
are interested. It traces external dependents, precedents, circularity, all
sorts of things really. There's a 30 day demo if you want to save some time.

Robin Hammond
www.enhanceddatasystems.com

> Hi,
> In my spreadsheet ther is a field that has a dependent in an other
[quoted text clipped - 5 lines]
> best rgds,
> Ton
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.