+ Reply to Thread
Results 1 to 4 of 4

Deleting duplicate entries

  1. #1
    J. Gutierrez
    Guest

    Deleting duplicate entries

    Hi everyone,

    I have a list with several thousand numbers (cancer morphology codes, many
    repeats) with their corresponding text name in the adjacent column. How can I
    delete all the repeats in the worksheet and be left with one of each number?

    Example...This is what I have now (no header column, data sorted by Column
    A, ascending values)

    A B
    1 8001 xxxxxx
    2 8001 xxxxxx
    3 8002 yyyyyy
    4 8002 yyyyyy
    5 8002 yyyyyy
    6 8003 zzzzzz
    7 8003 zzzzzz

    and this is what I would like to end up with...

    A B
    1 8001 xxxxxx
    2 8002 yyyyyy
    3 8003 zzzzzz

    Any suggestions?

    Thanks for everyones help.

    JG

  2. #2
    Michael
    Guest

    RE: Deleting duplicate entries

    Hi J. Try out Chip Pearson's site: http://www.cpearson.com/excel/duplicat.htm
    --
    Sincerely, Michael Colvin


    "J. Gutierrez" wrote:

    > Hi everyone,
    >
    > I have a list with several thousand numbers (cancer morphology codes, many
    > repeats) with their corresponding text name in the adjacent column. How can I
    > delete all the repeats in the worksheet and be left with one of each number?
    >
    > Example...This is what I have now (no header column, data sorted by Column
    > A, ascending values)
    >
    > A B
    > 1 8001 xxxxxx
    > 2 8001 xxxxxx
    > 3 8002 yyyyyy
    > 4 8002 yyyyyy
    > 5 8002 yyyyyy
    > 6 8003 zzzzzz
    > 7 8003 zzzzzz
    >
    > and this is what I would like to end up with...
    >
    > A B
    > 1 8001 xxxxxx
    > 2 8002 yyyyyy
    > 3 8003 zzzzzz
    >
    > Any suggestions?
    >
    > Thanks for everyones help.
    >
    > JG


  3. #3
    Nikki
    Guest

    RE: Deleting duplicate entries

    you can also create a Pivot table to elimiate the duplicates.

    "J. Gutierrez" wrote:

    > Hi everyone,
    >
    > I have a list with several thousand numbers (cancer morphology codes, many
    > repeats) with their corresponding text name in the adjacent column. How can I
    > delete all the repeats in the worksheet and be left with one of each number?
    >
    > Example...This is what I have now (no header column, data sorted by Column
    > A, ascending values)
    >
    > A B
    > 1 8001 xxxxxx
    > 2 8001 xxxxxx
    > 3 8002 yyyyyy
    > 4 8002 yyyyyy
    > 5 8002 yyyyyy
    > 6 8003 zzzzzz
    > 7 8003 zzzzzz
    >
    > and this is what I would like to end up with...
    >
    > A B
    > 1 8001 xxxxxx
    > 2 8002 yyyyyy
    > 3 8003 zzzzzz
    >
    > Any suggestions?
    >
    > Thanks for everyones help.
    >
    > JG


  4. #4
    Forum Contributor
    Join Date
    02-24-2005
    Posts
    154

    Duplicate row deleting

    Try this for size, works for me.

    For uY = 1 To 6 'Spin thru 6 times to get them all
    Qq = Application.CountA(ActiveSheet.Range("B:B")) 'Get row count before beginning
    For oZ = 2 To Qq 'Main loop
    If Cells(oZ, 1) = Cells(oZ - 1, 1) Then 'Check for dups
    Cells(oZ, 1).Select 'Select the cell
    Selection.Delete Shift:=xlUp 'Delete
    Qq = Qq - 1 'Change loop criteria because cell gone
    End If 'End
    Next oZ 'Inside loop
    Next uY 'Outside loop
    Last edited by grahammal; 11-04-2005 at 07:08 AM.

+ 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