Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Jun 2001
    Location
    Illinois
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Delete duplicate rows (Excel 2000)

    Hello,

    I have what I think is a fairly simple script to write. I have a .csv file and I need to remove the duplicate rows. Column B is a list of numbers that should be distinct, 1,2,3,4,4. I've attached an example file. There are 5000 rows and only about 2000 distince ones.

    Any help would be appreciated.

    Thank you,
    Justin Kuehlthau

    Why are .csv files not allowed to be posted?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Delete duplicate rows (Excel 2000)

    You can do this without code with Data | Filter | Advanced Filter, Copy, Unique Rows Only.

    If you prefer a macro:

    Sub DeleteDups()
    Dim lngRow As Long
    For lngRow = Range("A65536").End(xlUp).Row To 2 Step -1
    If Range("A" & lngRow) = Range("A" & (lngRow - 1)) Then
    Range("A" & lngRow).EntireRow.Delete
    End If
    Next lngRow
    End Sub

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Delete duplicate rows (Excel 2000)

    Oh, and you can post any file if you zip it, as long as the zip file is below 100 KB in size.

  4. #4
    Star Lounger
    Join Date
    Jun 2001
    Location
    Illinois
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Delete duplicate rows (Excel 2000)

    Hans,

    You're the best. I should have known Excel would have something that would do what I wanted.

    Thank you very much.

    Justin Kuehlthau

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •