title: Using a 3-column Collection in Excel VBA and searching it
body: <p>I am building an algorithm in excel vba to search for paths in a network. I am new to programming these types of problems.  Please don't suggest alternate software.  The problem should be very simple.</p>
  
  <p>Problem Description:
  Search a collection of data representing flows on arcs (3 "columns": from, to, flow)
  Identify path (start at source, find flow to "to", look up that "to" in the "from" field, find flow to that "to", and so on until another "from" cannot be found) from source to end of each path.</p>
  
  <p>Data looks like this:</p>
  
  <p>fromnode    tonode  flow</p>
  
  <p>1   2   4</p>
  
  <p>2   3   3</p>
  
  <p>3   4   2</p>
  
  <p>4   5   1</p>
  
  <p>7   6   1</p>
  
  <p>8   7   2</p>
  
  <p>Biggest hurdle:</p>
  
  <p>I am using a Collection to hold this data and setting it with the code below.</p>
  
  <p>Dim y As Collection
  Set y = New Collection
  y.Add Sheets("FlowDecomp_Solve").Range("fromtoflow").Value</p>
  
  <p>The data gets pulled in, but it looks like this:
  (tried a pic, but I'm a new user)</p>
  
  <p>Item 1</p>
  
  <p>Item 1(1)</p>
  
  <pre><code>  Item 1 (1,1)   1
  
    Item 1 (1,2)   2
  
    Item 1 (1,3)   4
  </code></pre>
  
  <p>So it shows that the Collection has 1 item instead of my # of arcs.  How do I access the Item1(1,2) type address for the collection.  Does each special value have a unique key?  How do I search through my collection and remove a specific row after I've used it in the code?</p>
  
  <p>THANK YOU SO MUCH FOR ANY HELP.</p>