+ Reply to Thread
Results 1 to 4 of 4

Can't filter "Unique" records from Filtered range

  1. #1
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365 Version 2501 64-bit
    Posts
    1,491

    Can't filter "Unique" records from Filtered range

    Apologies if this has been answered already, but couldn't find it when I searched.

    Sheet 2 has a five column database of records, with Project Numbers in Col A, and Client Names in Col C.

    Following Code filters the database to show only the records matching whichever Client is selected in D3 of another sheet. Works perfectly at that point.

    I then need to extract the "unique" Project Numbers from the filtered Col A, and copy the list to somewhere else, so I end up with a list of the Projects relating to the Client selected.

    Please Login or Register  to view this content.

    Any suggestions, pointers or alternative solutions welcome as ever

    Ochimus

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,888

    Re: Can't filter "Unique" records from Filtered range

    How about
    Please Login or Register  to view this content.

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Can't filter "Unique" records from Filtered range

    You can't filter for unique values in Autofilter.

    Few options.

    1. Use Advanced Filter Copy. It has argument to extract unique records that meet criteria.
    http://www.contextures.com/exceladvancedfiltervba.html

    2. Copy column A as is after first filter operation. Then paste as is and perform remove duplicates operation.
    https://msdn.microsoft.com/en-us/vba...s-method-excel

    3. Load column A after first filter operation into array. Then iterate over it and use Scripting.Dictionary to extract unique values by using coumn A value as key (implicitly adding to dictionary).
    This is bit more involved than above two, but is fastest method when working with large data set.

    If you need help in coding, please upload sample workbook.
    "Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
    ― Robert A. Heinlein

  4. #4
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365 Version 2501 64-bit
    Posts
    1,491

    Re: Can't filter "Unique" records from Filtered range

    CK,

    Many thanks for prompt response.

    If the question had been "complex" I would (as I usually do) upload a sample workbook.

    But in this case it was the principle I needed, so the Code was perfectly adequate, as you demonstrated by outlining various options, for which I am extremely grateful.

    Ochimus

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 01-22-2016, 09:21 AM
  2. Replies: 1
    Last Post: 02-20-2015, 01:13 PM
  3. Replies: 6
    Last Post: 01-30-2015, 03:13 PM
  4. Replies: 0
    Last Post: 11-22-2013, 01:36 PM
  5. Count unique records in a filtered range
    By jiminic in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 01-24-2009, 02:44 AM
  6. "Criteria Range" in the "Data/Filter/Advanced Filter" to select Du
    By TC in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-11-2005, 10:06 PM
  7. [SOLVED] Why does it say "Filter mode" instead of "X of Y records"?
    By lucky_jed in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-07-2005, 07:06 AM

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