• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to remove duplicate line items from a range

ThrottleWorks

Excel Ninja
Hi,

I want to remove duplicate line items from a range.
Please note, I am not trying ‘Remove duplicates’.

For example, I have a range A1:610
Column A is sorted. Column A has duplicate values.
Such as A2 = Yamaha, A3 = Yamaha A4 = Ducati.
I need to remove row A2 cause it is duplicate.
So the new range will be A2 = Yamaha A3 = Ducati.
Can anyone please help me in this.
 

Attachments

  • Chandoo.xlsx
    8.4 KB · Views: 5
I am confused. You are trying to remove duplicates no? Based on row header...

Or are you saying that you don't want to use remove duplicate method and use some other ways to eliminate duplicate?
 
I am confused too
Try:
Code:
Sub belleke()
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For x = LastRow To 2 Step -1
If Cells(x, 1).Value = Cells(x - 1, 1).Value Then
Cells(x, 1).EntireRow.Delete
Count = Count + 1
End If
Next x
End Sub
 
Back
Top