With Activesheet
lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = lastrow to 1 Step -1
If Not IsError(Application.Match(.Cells(i, "A").Value, .Columns(2),0)) Then
.Cells(i, "A").Delete Shift:=xlUp
End If
Next i
End With
I want a comparison to be done between the text values in column A & B. Find the matches and deleted the matching cell values from column A. Column B's data should not get deleted.
How do I do it?
Sub deleteA()
Dim endRow As String
Sheets("Sheet1").Select
endRow = Range("A65536").End(xlUp).Row
Range("A1", "A" & endRow).Select
For Each cell In Selection
cell.Select
i = ActiveCell.Row
If Range("A" & i) = Range("B" & i) Then ActiveCell.Clear
Next
End Sub