Возможно, попробуйте:
Sub conditionalCopying()
Dim Cpt As Long
inactiveRow = Worksheets("Inactive").Cells(Rows.Count, 1).End(xlUp).Row
Cutrow = Worksheets("Cutting").Cells(Rows.Count, 1).End(xlUp).Row
Cpt = Cutrow
For i = 2 To inactiveRow
If Worksheets("Inactive").Cells(i, 3).Value = "North" Then
For x = 2 To Cutrow
If Worksheets("Inactive").Cells(i, 1) <> Worksheets("Cutting").Cells(x, 1).Value Then
Cpt = Cpt + 1
Worksheets("Inactive").Rows(i).Copy
Worksheets("Cutting").Activate
b = Worksheets("Cutting").Cells(Cpt, 1).Select
ActiveSheet.Paste
Worksheets("Inactive").Activate
GoTo nexti
End If
Next x
End If
nexti:
Next i
End Sub
Отредактированный код Дайте попробовать
Sub conditionalCopying()
Dim Cpt As Long
inactiveRow = Worksheets("Inactive").Cells(Rows.Count, 1).End(xlUp).Row
Cutrow = Worksheets("Cutting").Cells(Rows.Count, 1).End(xlUp).Row
Cpt = Cutrow
For i = 2 To inactiveRow
If Worksheets("Inactive").Cells(i, 3).Value = "North" And Worksheets("Inactive").Cells(i, 1).Value = "11" Then
Cpt = Cpt + 1
Worksheets("Inactive").Rows(i).Copy
Worksheets("Cutting").Activate
b = Worksheets("Cutting").Cells(Cpt, 1).Select
ActiveSheet.Paste
Worksheets("Inactive").Activate
End If
Next i
ThisWorkbook.Sheets("cutting").Range("A1:D" & Cpt).RemoveDuplicates Columns:=Array(1, 2, 3, 4), Header:=xlYes
End Sub
Второе редактирование
Sub conditionalCopying()
Dim Cpt As Long
inactiveRow = Worksheets("Inactive").Cells(Rows.Count, 1).End(xlUp).Row
Cutrow = Worksheets("Cutting").Cells(Rows.Count, 1).End(xlUp).Row
Cpt = Cutrow
For i = 2 To inactiveRow
If Worksheets("Inactive").Cells(i, 3).Value = "North" Then
Cpt = Cpt + 1
Worksheets("Inactive").Rows(i).Copy
Worksheets("Cutting").Activate
b = Worksheets("Cutting").Cells(Cpt, 1).Select
ActiveSheet.Paste
Worksheets("Inactive").Activate
End If
Next i
ThisWorkbook.Sheets("cutting").Range("A1:D" & Cpt).RemoveDuplicates Columns:=Array(1, 2, 3, 4), Header:=xlYes
End Sub