+ Reply to Thread
Results 1 to 5 of 5

Remove Duplicates from Advanced Filter Results

Hybrid View

  1. #1
    Registered User
    Join Date
    02-26-2008
    MS-Off Ver
    Excel 2016
    Posts
    23

    Remove Duplicates from Advanced Filter Results

    Hello,
    I'm a rookie at VBA.
    I have the following macro that performs an advanced filter. I want it to take the results from the advanced filter and remove any results that have duplicate values in column 17.

    Sub CreateFilteredRange()
    
    Dim lastTransactionCell As String
    
        lastTransactionCell = Range("Reference!Receipt_Table_Last_Row").Text
    
        Sheets("Results").Select
        Sheets("Results").Cells.Clear
        ActiveWorkbook.Save
        Sheets("TransactionDataFromWeb").Range("A1",
    lastTransactionCell).AdvancedFilter Action:= _
            xlFilterCopy, CriteriaRange:=Range("Reference!Criteria"),
    CopyToRange:=Range _
            ("A1"), Unique:=False
    End Sub
    Thanks in advance for the help!
    Last edited by joedrummer; 06-24-2013 at 03:44 PM.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Remove Duplicates from Advanced Filter Results

    Hi Joedrummer,

    Try changing Unique:=True in the code.
    Also, I need to see column 17 as well and would be helpful if you could upload a sample workbook. thanks.



    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Registered User
    Join Date
    02-26-2008
    MS-Off Ver
    Excel 2016
    Posts
    23

    Re: Remove Duplicates from Advanced Filter Results

    Thanks for the reply DILIPandey,
    I'm attaching a file.
    SampleFile.xlsm
    In the current data table the NumericalID (from column 17) 8619 shows up two times, as the rows do not match exactly. However I only want the NumericalID 8619 to show up once. It does not matter to me which row is deleted as I'm not interested in any of the unique data.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,051

    Re: Remove Duplicates from Advanced Filter Results

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Remove Duplicates from Advanced Filter Results

    Hi Joedrummer,

    First follow the instructions of MOD and then we can continue. thanks.

    Regards,
    DILIPandey
    <click on below * if this helps>

+ 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