I have this little script that works well, unless it encounters an email address that isn't exactly a match.
As an example, if I had john.doe@email.com on sheet1 and john.DOE@email.com on sheet0, the row john.DOE@email.com is on would not be deleted.
How can I get around that?
As an example, if I had john.doe@email.com on sheet1 and john.DOE@email.com on sheet0, the row john.DOE@email.com is on would not be deleted.
How can I get around that?
VBA Code:
Sub delete()
Dim x As Long, z As Long, lr0 As Long, lr1 As Long
Dim wss As Sheets
Dim ws0 As Worksheet, ws1 As Worksheet
Set wss = ThisWorkbook.Worksheets
Set ws0 = wss("Sheet0")
Set ws1 = wss("Sheet1")
lr0 = ws1.Cells(Rows.Count, 1).End(xlUp).Row
lr1 = ws2.Cells(Rows.Count, 1).End(xlUp).Row
For x = lr0 To 1 Step -1
For z = 1 To lr1
With ws0
If .Range("C" & x) = ws1.Range("A" & z) Then .Rows(x).delete
End With
Next z
Next x
End Sub