Consulting

Results 1 to 14 of 14

Thread: Searching with recursion

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Expert
    Joined
    Aug 2004
    Posts
    810
    Location

    Searching with recursion

    This is just driving me nuts and turn my head inside out. I am trying to do some recursion () with searching (I think this is what I need....). What I need is trying to find a chain of connections. With the attached file, I need to start with "From LSD" and "To LSD". Use the "To LSD" and search the "From LSD" and see where that match is. Then for every match do the same searches until there is no more matches or they are equal. When they matched, I wanted the "Asset Number" to be unioned with all the matched ones.

    Example:
    row 2 - "To LSD" = 05-08-043-01 W4 wanted to match all "From LSD", result below:
    1103743 -- 05-08-043-01 W4 -- 08-07-043-01 W4
    1104288 -- 05-08-043-01 W4 -- 03-17-043-01 W4
    5708836 -- 05-08-043-01 W4 -- 06-08-043-01 W4
    5710469 -- 05-08-043-01 W4 -- 05-08-043-01 W4 <---- this would be a "dead end" From and To are the same
    1103815 -- 05-08-043-01 W4 -- 06-08-043-01 W4
    1103819 -- 05-08-043-01 W4 -- 05-08-043-01 W4
    1103775 -- 05-08-043-01 W4 -- 02-07-043-01 W4
    1103785 -- 05-08-043-01 W4 -- 12-08-043-01 W4
    1104325 -- 05-08-043-01 W4 -- 03-17-043-01 W4
    1104362 -- 05-08-043-01 W4 -- 08-07-043-01 W4



    I would like all those asset numbers to be captured (maybe concatenate and put into Column D) and then do it all over again using the above list until the above list is done (recursion, would be the best??). Now, do row 3, do the same thing over and over....

    PS - I am just thinking out loud here, I don't know if I want to do this for the entire sheet or just a active cell..... I will take any suggestion
    Attached Files Attached Files

Posting Permissions

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