Rangolijaro
New Member
- Joined
- Jun 10, 2019
- Messages
- 4
need to ignore blank cells in column X
tried this code but it deleted all "nothing" cells
Sub Deleteduplicate()
Dim N As Long
N = Cells(Rows.Count, "X").End(xlUp).Row
For i = N To 2 Step -1
Set rlook = Range(Cells(i - 1, "X"), Cells(1, 1))
If Application.WorksheetFunction.CountIf(rlook, Cells(i, "X")) > 0 Then
Cells(i, "X").EntireRow.Delete
End If
Next i
End Sub
tried this code but it deleted all "nothing" cells
Sub Deleteduplicate()
Dim N As Long
N = Cells(Rows.Count, "X").End(xlUp).Row
For i = N To 2 Step -1
Set rlook = Range(Cells(i - 1, "X"), Cells(1, 1))
If Application.WorksheetFunction.CountIf(rlook, Cells(i, "X")) > 0 Then
Cells(i, "X").EntireRow.Delete
End If
Next i
End Sub