hi all
I have this macro but it's taking too long, I usually have about 7000 rows. this macro deletes rows in sheet1 based on values in sheet2.
is there a way to improve my current macro to run faster?
thank you!
I have this macro but it's taking too long, I usually have about 7000 rows. this macro deletes rows in sheet1 based on values in sheet2.
is there a way to improve my current macro to run faster?
thank you!
VBA Code:
Sub XYZ()
Dim LR As Long, i As Long
With Sheets("Sheet1")
LR = .Range("A" & Rows.Count).End(xlUp).Row
For i = LR To 1 Step -1
If IsNumeric(Application.Match(.Range("A" & i).Value, Sheets("Sheet2").Columns("A"), 0)) Then .Rows(i).Delete
Next i
End With
End Sub
Last edited by a moderator: