+ Reply to Thread
Results 1 to 3 of 3

i want to delete duplicate items in a list using code.

  1. #1
    ndm berry
    Guest

    i want to delete duplicate items in a list using code.

    I have a dynamic list of 2 columns wide in alphabetical order(all items are
    text). The first column contains many different duplicate items (these are
    together as its in alpha order), the second column's items are all unique. I
    wish to delete the first of each of the duplicate items and close all gaps in
    order to reduce the length of the list. I am using Excel 2002.

  2. #2
    Vacation's Over
    Guest

    RE: i want to delete duplicate items in a list using code.

    search "unique" and then "empty rows" on John's site

    http://www.j-walk.com/ss/excel/tips/misc.htm

    "ndm berry" wrote:

    > I have a dynamic list of 2 columns wide in alphabetical order(all items are
    > text). The first column contains many different duplicate items (these are
    > together as its in alpha order), the second column's items are all unique. I
    > wish to delete the first of each of the duplicate items and close all gaps in
    > order to reduce the length of the list. I am using Excel 2002.


  3. #3
    Tom Ogilvy
    Guest

    Re: i want to delete duplicate items in a list using code.



    Sub aa()
    Dim lastrow As Long
    Dim i As Long
    lastrow = Cells(Rows.Count, 1).End(xlUp).Row
    For i = lastrow To 2 Step -1
    If Cells(i, 1).Value = Cells(i - 1, 1).Value Then
    Cells(i, 1).Delete Shift:=xlShiftUp
    End If
    Next

    End Sub


    --
    Regards,
    Tom Ogilvy




    "ndm berry" <[email protected]> wrote in message
    news:[email protected]...
    > I have a dynamic list of 2 columns wide in alphabetical order(all items

    are
    > text). The first column contains many different duplicate items (these

    are
    > together as its in alpha order), the second column's items are all unique.

    I
    > wish to delete the first of each of the duplicate items and close all gaps

    in
    > order to reduce the length of the list. I am using Excel 2002.




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1