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)
this next part is where I need help:
- loop through only the visible rows in sheet A
- check if the first column matches any row in the first column of sheet b
- 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.
- 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.
with ThisWorkbook.Sheets(sheet_name)
Dim open_package As Range
Set open_package = ThisWorkbook.Sheets("Open Packages").Range("A2", Range("A" & Rows.Count).End(xlUp))
Dim rng3 As Range
Dim rng_package As Range
Set rng_package = Range("A1", Range("A" & 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) & " " & cl_package.Cells(2))
Next rng3
Next cl_package
End With
I am trying to troubleshoot the nested loop to see exactly in what way is it looping through everything.