Hello, below VBA code works for me, i am comparing 2 columns and deleting the entire row if the values are the same. the columns to compare will vary, so i need to add input box(es) so that the user can put in the 2 columns that they want to compare.
Sub Delete_Same_City()
'delete row if property city in Column D and mailing city in column AC are the same
Dim endRow As Long
endRow = Sheet1.Range("A999999").End(xlUp).Row
For i = 1 To endRow
If Sheet1.Range("D" & i).Value = Sheet1.Range("AC" & i).Value Then
Sheet1.Range("AC" & i).EntireRow.Delete
End If
Next i
End Sub
Sub Delete_Same_City()
'delete row if property city in Column D and mailing city in column AC are the same
Dim endRow As Long
endRow = Sheet1.Range("A999999").End(xlUp).Row
For i = 1 To endRow
If Sheet1.Range("D" & i).Value = Sheet1.Range("AC" & i).Value Then
Sheet1.Range("AC" & i).EntireRow.Delete
End If
Next i
End Sub