+ Reply to Thread
Results 1 to 7 of 7

Get unique values with VBA (advanced filter)

  1. #1
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    481

    Get unique values with VBA (advanced filter)

    Hi all,

    I need to paste unique values (based on multiple criteria) from my data set to another sheet and want to use VBA in order to avoid using array formulas and slowing my file down significantly. I'm not that familiar with using advanced filtering, but that might be the best option, as it is an Excel built-in function? Open to other efficient solutions...

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by esbencito; 12-07-2018 at 04:24 AM. Reason: added first VBA attempt

  2. #2
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    729

    Re: Get unique values with VBA (advanced filter)

    try

    Please Login or Register  to view this content.
    Regards,
    MohanS


    "Perfection is not attainable, but if we chase perfection we can catch excellence." - Vince Lombardi

    You can simply say thanks by clicking "*Add Reputation" icon

  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Get unique values with VBA (advanced filter)

    Another way.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  4. #4
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    481

    Re: Get unique values with VBA (advanced filter)

    mohan.r1980,

    This seems to ignore the 2 criteria I have...
    Last edited by jeffreybrown; 12-07-2018 at 08:12 AM. Reason: Removed full quote!

  5. #5
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    481

    Re: Get unique values with VBA (advanced filter)

    bakerman2,

    Thanks. Great solution! A little slow in my actual data set though. Is there a more efficient way to do this, such as Advanced Filtering?
    Last edited by jeffreybrown; 12-07-2018 at 08:13 AM. Reason: Removed full quote!

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Get unique values with VBA (advanced filter)

    Try this for starters.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    481

    Re: Get unique values with VBA (advanced filter)

    Thanks bakerman2!! This is a good start! Do you also happen to know how to filter only the unique items in "KEY PROGRAM"? It currently returns the item "STRETCH CHINO" twice. The "<>" sign in the criteria range is only used to get rid of the blanks I assume?

+ 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: 5
    Last Post: 12-19-2013, 06:58 AM
  2. Posting Unique Values (Other Than Using Advanced Filter)
    By brandnew22 in forum Excel General
    Replies: 2
    Last Post: 08-06-2013, 08:55 AM
  3. [SOLVED] Run-time error 1004 when running Advanced Filter for Unique Values in macro
    By jacobadger in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-17-2012, 02:17 PM
  4. Advanced filter to get unique values
    By brumbarchris in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-13-2012, 12:21 PM
  5. Advanced Filter - Unique Values Macro Returns 1st Value Twice
    By r101 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-11-2011, 05:53 PM
  6. Formula to replace advanced filter option for unique values
    By scaffdog845 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-11-2009, 06:53 PM
  7. Return Unique Text Values without Advanced Filter
    By nicknick5219 in forum Excel General
    Replies: 11
    Last Post: 05-21-2009, 10:15 AM
  8. Advanced Filter - Unique Values
    By EstherJ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2005, 09:05 AM

Tags for this Thread

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