title: How can I loop through a filtered table and check if each row is in another sheet using vba?
body: <p>I have 2 worksheets. Lets call them worksheet A and worksheet B. In worksheet A I automatically pull in a huge amount of data and apply the proper filters to narrow down to the critical data (see image)</p>
  
  <p>this next part is where I need help:</p>
  
  <ol>
  <li>loop through only the visible rows in sheet A</li>
  <li>check if the first column matches any row in the first column of sheet b </li>
  <li>if it does match then I need to check that the second column in that same row in sheet A also matches the second column in the matched row in sheet B.</li>
  <li>if it passes both those test then I need to copy the whole row and append it to the end of the data in row B. </li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/M0Z4Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M0Z4Y.png" alt="enter image description here"></a>
  so far I have:</p>
  
  <pre><code>    with ThisWorkbook.Sheets(sheet_name) 
      Dim open_package As Range
      Set open_package = ThisWorkbook.Sheets("Open Packages").Range("A2", Range("A" &amp; Rows.Count).End(xlUp))
      Dim rng3 As Range
  
  
  
      Dim rng_package As Range
      Set rng_package = Range("A1", Range("A" &amp; Rows.Count).End(xlUp)).SpecialCells(xlCellTypeVisible)
      Dim cl_package As Range
  
  
      For Each cl_package In rng_package.Rows
          For Each rng3 In open_package
              MsgBox rng3
              Debug.Print (cl_package.Cells(1) &amp; " " &amp; cl_package.Cells(2))
          Next rng3
      Next cl_package
  End With
  </code></pre>
  
  <p>I am trying to troubleshoot the nested loop to see exactly in what way is it looping through everything. </p>