Can you help me please? I have two sheets that I need to compare, Sheet 1 and Sheet 2, those that are exists in Sheet1, or they have the item then it will automatically be deleted.. Thank you guys in advance.
I have this code that I got on the internet. please help me where is the possible error, because below macro highlights only the cells but not deleted the common of the sheets.
Public Sub CompareSheets()
Dim ws1 As Worksheet, ws2 As Worksheet
Dim cell As Range, rng As Range
Set ws1 = Worksheets("Sheet1")
Set ws2 = Worksheets("Sheet2")
Set rng = ws1.Range("D2:D1500")
For Each cell In rng
Celladdress = cell.Address
If cell <> ws2.Range(Celladdress) Then
cell.Interior.Color = vbYellow
ws2.Range(Celladdress).Interior.Color = vbYellow