+ Reply to Thread
Results 1 to 10 of 10

Create a Distinct Unique list for 2 Columns

  1. #1
    Forum Contributor
    Join Date
    04-20-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    160

    Create a Distinct Unique list for 2 Columns

    Hello,

    So far I created code that creates a Distinct Unique item's list for one column. It works as it should but I want to modify the code to create a Distinct Unique item's list for two columns that are related to another i.e. a person's name to their license #.
    Here is the code below that works for one column only:

    Please Login or Register  to view this content.
    I would really like it to work for two columns and have the data spit out in columns starting E2 to F (whatever the last row would be). So if I had the code right for two columns i.e. license # would always match up with the right name.

    Thanks,

    Bc

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Create a Distinct Unique list for 2 Columns

    You need to change the columns to suite your need.
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    04-20-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    160

    Re: Create a Distinct Unique list for 2 Columns

    Hi AB33,

    The code you suggested combines the output in one column which is not correct. I want it to spit the data out in 2 columns i.e. for example license # would be spit out in E and person's name in column F. The columns are related so amount of items should be the same just in separate columns. Also in your code I changed "E2:F" to "C2:D" because that's where the data starts. It should get spit out to E2:F.

    - let me know if this makes sense

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Create a Distinct Unique list for 2 Columns

    I assumed you want to the keys based on two columns, but this might not be the case.
    I do not know which one you want to split up, but if you want to display the keys and items on two different columns.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    04-20-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    160

    Re: Create a Distinct Unique list for 2 Columns

    AB33,

    I see what you are saying...Here is what I have....

    In Column C I have "license #'s" and in Column D I have "names". When the list is created the license #'s in Column C will populated in Column E and the names will be populated separately in Column F. Right now I get the concatenation of both C and D in Column E, not what I am looking for. I want those separated, license #'s in E and names in F.

    I also want to say thank you for your time.

    -bc

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Create a Distinct Unique list for 2 Columns

    boldcode,
    Please attach a sample as it would be easily to see and test it.

  7. #7
    Forum Contributor
    Join Date
    04-20-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    160

    Re: Create a Distinct Unique list for 2 Columns

    AB33,

    Here is the example attached. The macro name in the attached workbook is "test" and you can run it in the worksheet "TestSheet". The other two worksheets in the workbook just describe what the macro is doing now (worksheet: ResultsNow) and what I would like the macro to do (worksheet: ResultsWanted).

    Thanks again.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Create a Distinct Unique list for 2 Columns

    Try the attached.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    04-20-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    160

    Re: Create a Distinct Unique list for 2 Columns

    AB33,

    Your solution works great! Thank you for your time.

    - BC
    Last edited by boldcode; 08-06-2014 at 05:08 PM. Reason: Solved

  10. #10
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Create a Distinct Unique list for 2 Columns

    Boldcode,
    You are welcome!

+ 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] Create a distinct list based on other criteria
    By tomtheappraiser in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-29-2014, 12:59 PM
  2. Replies: 7
    Last Post: 07-27-2013, 10:11 PM
  3. [SOLVED] Create list returning unique criteria covering several columns using arrays
    By joannelittell in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-24-2013, 04:37 PM
  4. [SOLVED] Create list returning unique criteria covering several columns
    By joannelittell in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-23-2013, 04:27 PM
  5. [SOLVED] Unique distinct alphabetically sorted list
    By atlant15 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-06-2013, 10:03 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