+ Reply to Thread
Results 1 to 2 of 2

Getting grip on dependents

  1. #1
    tondewilde
    Guest

    Getting grip on dependents

    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



  2. #2
    Robin Hammond
    Guest

    Re: Getting grip on dependents

    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

    "tondewilde" <[email protected]> wrote in message
    news:%[email protected]...
    > 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
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1