+ Reply to Thread
Results 1 to 16 of 16

Extract Unique Values from Long list and Put in Sorted Order

  1. #1
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Extract Unique Values from Long list and Put in Sorted Order

    Hi,

    I have seen part of what I need but not all of it.

    Sheet1, Column A contains thousands of values, including blanks, with many values duplicated, in no particular order.

    Sheet2, Column A needs to contain a sorted (ascending) list of unique/distinct values, excluding blanks, from sheet 1.

    Can someone suggest a soluton?

    Thanks!

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,522

    Re: Extract Unique Values from Long list and Put in Sorted Order

    Change xlNo to xlYes if you have header.
    Please Login or Register  to view this content.

  3. #3
    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
    52,929

    Re: Extract Unique Values from Long list and Put in Sorted Order

    A non-VBA solution would be to copy all data from A to B, then use excel's "remove duplicates" option (data/Data Tools), and then sort what remains
    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

  4. #4
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Extract Unique Values from Long list and Put in Sorted Order

    I need to automate this so that it extracts and sorts when the sheet is opened by the user.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,522

    Re: Extract Unique Values from Long list and Put in Sorted Order

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Extract Unique Values from Long list and Put in Sorted Order

    Hi Jindon,

    Perfect! Marvelous!

    Domo Arigato!

    tom

  7. #7
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Extract Unique Values from Long list and Put in Sorted Order

    Hey Jindon,

    One glitch:

    I have formulas in the receiving spreadsheet so while I see the reasoning in clearing the contents, I need to make it happen only to column A.

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,522

    Re: Extract Unique Values from Long list and Put in Sorted Order

    Try change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Extract Unique Values from Long list and Put in Sorted Order

    Hmmm, I must be doing something wrong. I changed the line but upon saving then restarting, the column does not seem to have been erased (i put some bogus data below where the good stuff ended).

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,522

    Re: Extract Unique Values from Long list and Put in Sorted Order

    Can you upload your workbook?

  11. #11
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Extract Unique Values from Long list and Put in Sorted Order

    Probably not...it is over 3mb. I will put a sample together and upload shortly.

  12. #12
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Extract Unique Values from Long list and Put in Sorted Order

    Here ya go, Jindon.
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Extract Unique Values from Long list and Put in Sorted Order

    Jindon, the file I sent was missing the End Sub, which I know you will see immediately. It populates column A the first time, but when i delete some entries and add sume extra stuff down below, save and reopen, it does not work. hope you are seeing what I am seeing. tom

    It works like a champ when I execute from VBE. The problem seems to be executing upon activation.
    Last edited by snapfade; 04-08-2013 at 08:36 PM.

  14. #14
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,522

    Re: Extract Unique Values from Long list and Put in Sorted Order

    It should be placed in Sheet2 code module.
    Changed a bit for speeding up.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Extract Unique Values from Long list and Put in Sorted Order

    Jindon, I figured it out. Had to put the code in Sheet2. Beautiful. Thanks ever so much for your help. I really appreciate it.

    tom

  16. #16
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Extract Unique Values from Long list and Put in Sorted Order

    Hey Jindon,

    If I have columns B through S with formulas on sheet2 and want them to be copied to all the rows where the extracted values appear, how would I do that? assuming that the row of formulas in row one is valid if copied to all rows.

    I promise, no more questions after this! ;-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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