+ Reply to Thread
Results 1 to 4 of 4

Remove Duplicate numbers

  1. #1
    Registered User
    Join Date
    09-12-2011
    Location
    Spring Lake, Mi
    MS-Off Ver
    Excel 2010
    Posts
    15

    Remove Duplicate numbers

    Excel Guru's;

    I need help with a macro that will look for an item number duplicate and keep the top row of the duplicate but remove any other rows below it with the same number. I am not an expert with Macros and can really use some help from an expert. I attached a file and if you look at row 103 you will see an item number 1007:00527344 which is fine but you will also see the same number through row 108 which talks about QTY in the description only. I need the rows removed that are the same number below the first row with the number. In other words in this case I would want 103 kept and 104-108 removed. If there are any others with the same case then it would need to do the same thing.. In other words when there is a duplicate number I will only need the top # which is the actual number and description I can import.Thanks for the help experts. If you have questions let me know. The file is attached.

    bzenker
    Attached Files Attached Files

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Remove Duplicate numbers

    You can do this with the remove duplicates function, select your range, then go to Data->Remove Duplicates, remove the check box from all columns that you do not want to check, leaving only the one you do want to check. it will remove all items that are duplicated leaving only the first instance.
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Remove Duplicate numbers

    Try this

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    04-01-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Remove Duplicate numbers

    Sub RemDup()
    '
    ' RemDup Macro
    '

    '


    I think this would do the trick...reply if anything more is required....
    Range("D3").Select
    Range(Selection, Selection.End(xlDown)).Select
    Range("D3:G2477").Select
    ActiveSheet.Range("$D$2:$G$2477").RemoveDuplicates Columns:=Array(1, 2, 3, 4), _
    Header:=xlYes
    Range("I9").Select
    End Sub

+ 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