Private Sub cmd_Import_Click()
Application.ScreenUpdating = False
Dim r, i As Workbook
Dim rws2, iws1 As Worksheet
Dim Rng As Range
Dim RngList As Object
Dim rLR2 As Long
Set r = ThisWorkbook
Set rws2 = ThisWorkbook.Sheets("Consolidated")
Set RngList = CreateObject("Scripting.Dictionary")
Set i = Workbooks.Open("[URL="file://\\Path"]\\Path[/URL]")
Set iws1 = i.Sheets("Data")
For Each Rng In rws2.Range("C2", rws2.Range("C" & rws2.Rows.Count).End(xlUp))
If Not RngList.Exists(Rng.Value & Rng.Offset(0, 9)) Then 'I need to also add a condition to look at Offset 0,2
RngList.Add Rng.Value & Rng.Offset(0, 9), Nothing
End If
Next
For Each Rng In iws1.Range("A2", iws1.Range("A" & iws1.Rows.Count).End(xlUp))
If Not RngList.Exists(Rng.Value & Rng.Offset(0, 4)) Then 'I need to also add a condition to look at Offset 0,2
rws2.Range("C" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("A" & Rng.Row)
rws2.Range("D" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("B" & Rng.Row)
rws2.Range("F" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("C" & Rng.Row)
rws2.Range("J" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("D" & Rng.Row)
rws2.Range("L" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("E" & Rng.Row)
rws2.Range("M" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("F" & Rng.Row)
rws2.Range("N" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("G" & Rng.Row)
rws2.Range("O" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("H" & Rng.Row)
rws2.Range("P" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("I" & Rng.Row)
rws2.Range("Q" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("J" & Rng.Row)
rws2.Range("S" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("K" & Rng.Row)
rws2.Range("T" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("L" & Rng.Row)
rws2.Range("U" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("M" & Rng.Row)
rws2.Range("V" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("N" & Rng.Row)
rws2.Range("W" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("O" & Rng.Row)
rws2.Range("Y" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("P" & Rng.Row)
If iws1.Range("Q" & Rng.Row) = "" Then
rws2.Range("Z" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("R" & Rng.Row)
Else
rws2.Range("Z" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = Trim(iws1.Range("Q" & Rng.Row) & " " & iws1.Range("R" & Rng.Row))
End If
rws2.Range("AA" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("S" & Rng.Row)
rws2.Range("AB" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("T" & Rng.Row)
rws2.Range("AC" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("U" & Rng.Row)
rws2.Range("AD" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("V" & Rng.Row)
rws2.Range("AE" & rws2.Rows.Count).End(xlUp).Offset(1, 0) = iws1.Range("W" & Rng.Row)
End If
Next
RngList.RemoveAll
Workbooks("Pending_Import").Close
Application.ScreenUpdating = True
End Sub