View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] mike.wilson8@comcast.net is offline
external usenet poster
 
Posts: 20
Default compare two worksheets and delete rows

I currently have this existing code that checks to if the value is the
same between col E and P and if true, the row is deleted.

'lastrow = Cells(Rows.Count, 4).End(xlUp).Row
'For i = lastrow To 1 Step -1
' If Cells(i, "E").Value = Cells(i, "P").Value Then
' Rows(i).Delete
'End If
'Next


How can I change this to compare values between col A in worksheet 1
and col A in worksheet 2, and if the value is the same, delete that row
in worksheet 1?

Thank you,
Mike