Código corrigido deu certo agora!
Sub NaoTestado()
Dim rRange1 As Range, rRange2 As Range, rRange3 As Range
Dim lLoop As Long
Set rRange2 = Plan3.Range("A2", Plan3.Cells(Rows.Count, "A").End(xlUp))
Set rRange1 = Plan1.Range("A2", Plan1.Cells(Rows.Count, "O").End(xlUp))
Set rRange3 = Plan2.Range("A2", Plan2.Cells(Rows.Count, "D").End(xlUp))
With WorksheetFunction
For lLoop = rRange1.Rows.Count To 1 Step -1
If .CountIf(rRange2, rRange1.Cells(lLoop, 1)) > 0 _
Then rRange1.Cells(lLoop, 1).EntireRow.Delete
Next lLoop
End With
With WorksheetFunction
For lLoop = rRange3.Rows.Count To 1 Step -1
If .CountIf(rRange2, rRange3.Cells(lLoop, 1)) > 0 _
Then rRange3.Cells(lLoop, 1).EntireRow.Delete
Next lLoop
End With
End Sub
Postado : 17/07/2014 11:29 am