+ Reply to Thread
Results 1 to 4 of 4

Get Unique Items

  1. #1
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Get Unique Items

    I have a range named MyItems.
    I want have a macro to list the unique items in MyItems in a message box.
    Please advise.
    Thanks

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Get Unique Items

    This is simplicity itself.

    This is the classic description of the difference between a collection and an array.

    The process is:-

    Read your range into an Array if it is a list it is probably a single array

    create a new collection

    read each member of your array into the collection.

    The collection requires an address and an entry

    if you use the entry as its address then each duplicate entry will overwrite its predecessor.


    Now read the collection into a new array and save back to excel.

    In your case, read every entry of your collection into a text variable

    Display the text variable using a message box.

    Sounds Long Winded but the bulk of the work has been done for you.



    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 10-03-2014 at 09:30 PM.

  3. #3
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Get Unique Items

    If your MyItems is a named range on a worksheet (code easily modified if otherwise) you could also try
    Please Login or Register  to view this content.

  4. #4
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Get Unique Items

    You can also try this...
    Getting Uniques
    Function syntax is UniqueCol(Range_Arr)

    Please Login or Register  to view this content.
    Regards,
    Last edited by Vikas_Gautam; 10-03-2014 at 11:32 PM.
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

+ 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. [SOLVED] unique items
    By santanuKD in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-15-2013, 04:46 PM
  2. [SOLVED] Counting # of Unique Items In List & Listing Unique Items In A List
    By unpluggedmusic in forum Excel General
    Replies: 3
    Last Post: 12-05-2012, 11:44 AM
  3. Excel 2007 : Sum of unique items
    By Ger/starter in forum Excel General
    Replies: 12
    Last Post: 10-05-2010, 06:19 AM
  4. Unique Items
    By JatinderSheoran in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2008, 04:07 PM
  5. Unique Items
    By Buska in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-29-2005, 07:02 PM

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