Hi. I have the following code but it runs rather slow as there is about 1500 rows. Any idea how to speed it up? Macro looks at sheet F and sheet CG and if a certain few cells exists already in sheet CG that is in sheet F, then this deletes the row from sheet F
Sub Remy()
Dim rsht1 As Long, rsht2 As Long
rsht1 = Sheets("F").Range("B" & Rows.Count).End(xlUp).Row
rsht2 = Sheets("CG").Range("B" & Rows.Count).End(xlUp).Row
For i = 1 To rsht1
For j = 1 To rsht2
If Sheets("F").Range("B" & i) = Sheets("CG").Range("B" & j) And Sheets("F").Range("C" & i) = Sheets("CG").Range("C" & j) _
And Sheets("F").Range("D" & i) = Sheets("CG").Range("D" & j) _
And Sheets("F").Range("F" & i) = Sheets("CG").Range("F" & j) Then
Sheets("F").Rows(i).Select
Selection.Delete Shift:=xlUp
End If
Next
Next
End Sub
Bookmarks