Hello Darren,
To delete the entire row this line needs to be changed from:
Sheets("Master").Cells(iCtr, 1).Delete xlShiftUpHere is the revised
to:
Sheets("Master").Cells(iCtr, 1).EntireRow.Delete xlShiftUpcode
Here is the revised code...
' Loop through the "master" list.
For Each x In Sheets("Sheet2").Range("A1:A2500")
' Loop through all records in the second list.
For iCtr = 1 To iListCount
' Do comparison of next record.
' To specify a different column, change 1 to the column number.
If x.Value = Sheets("Master").Cells(iCtr, 1).Value Then
' If match is true then delete row.
Sheets("Master").Cells(iCtr, 1).EntireRow.Delete xlShiftUp
' Increment counter to account for deleted row.
iCtr = iCtr + 1
End If
Next iCtr
Next
Application.ScreenUpdating = True
MsgBox "Done!"
End Sub
Sincerely,
Leith Ross
Bookmarks