+ Reply to Thread
Results 1 to 19 of 19

Two columns unique distinct values to listbox

  1. #1
    Registered User
    Join Date
    09-15-2018
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    18

    Two columns unique distinct values to listbox

    I have two columns and I need to get the unique value, the columns are in different sheets.

    I attach an example, but there is an error, it shows me all the values ​​and only the number 7 and 5 should appear in the list box

    thanks a lot
    Attached Files Attached Files

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

    Re: Two columns unique distinct values to listbox

    Are sure about what you are asking?
    1)
    I have two columns and I need to get the unique value, the columns are in different sheets.
    There's only one sheet.

    2)You are asking
    Two columns unique distinct values to listbox
    I attach an example, but there is an error, it shows me all the values ​​and only the number 7 and 5 should appear in the list box
    What do you mean by unique distinct values?

  3. #3
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523

    Re: Two columns unique distinct values to listbox

    Hi diegoasm11,

    Based on your posted workbook this will do the job:

    Please Login or Register  to view this content.
    Though my solution works, if jindon does post a solution I would use his

    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  4. #4
    Registered User
    Join Date
    09-15-2018
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    18

    Re: Two columns unique distinct values to listbox

    1 IS AN EXAMPLE, ASSUME COLUMN A IS ON SHEET 1 AND COLUMN B IS ON SHEET 2
    1 1
    2 2
    3 3
    4 4
    5
    6 6
    7
    8 8
    9 9
    10 10

    2 in the userform1 , in the list box appears all the numbers, but I need Appears the Number 5 and 7, they are the only unduplicated numbers

  5. #5
    Registered User
    Join Date
    09-15-2018
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    18

    Re: Two columns unique distinct values to listbox

    Quote Originally Posted by Trebor76 View Post
    Hi diegoasm11,

    Based on your posted workbook this will do the job:

    Please Login or Register  to view this content.
    Though my solution works, if jindon does post a solution I would use his

    Regards,

    Robert
    thanks, but if the range are in different sheets suppose sheet1 sheet2

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

    Re: Two columns unique distinct values to listbox

    What if there is another 5 in sheet1?

    Do you need 5,5,7 or 5, 7?

  7. #7
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: Two columns unique distinct values to listbox

    Hi
    As I understand
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    09-15-2018
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    18

    Re: Two columns unique distinct values to listbox

    Quote Originally Posted by jindon View Post
    What if there is another 5 in sheet1?

    Do you need 5,5,7 or 5, 7?
    example
    1. Sheet1 numbers 1 2 3 4 5 6 7 8 9 10
    sheet2 numbers 1 2 3 4 6 8 9 10

    the userform in the list box show numbersAttachment 724995

  9. #9
    Registered User
    Join Date
    09-15-2018
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    18

    Re: Two columns unique distinct values to listbox

    Quote Originally Posted by mohadin View Post
    Hi
    As I understand
    Please Login or Register  to view this content.

    thank you very much the code works

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

    Re: Two columns unique distinct values to listbox

    My understanding.
    Please Login or Register  to view this content.

  11. #11
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: Two columns unique distinct values to listbox

    You are welcome
    And thank you for the feedback
    Be happy & safe

  12. #12
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,513

    Re: Two columns unique distinct values to listbox

    In E2 then copy down.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  13. #13
    Registered User
    Join Date
    09-15-2018
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    18

    Re: Two columns unique distinct values to listbox

    Quote Originally Posted by mohadin View Post
    Hi
    As I understand
    Please Login or Register  to view this content.
    Hi again, if I want sheet one to be the parent list and sheet two to change

    example

    hoja1 hoja2
    1 1
    2 2
    3 7
    4 4
    5 9
    6 6

    In column 1 of sheet 2, the number 3 and 5 are needed, but in list 1 the values ​​3 5 7 9 appear, since 7 9 are what is missing in column 1 of sheet 1, I need them to appear only what is missing from column 1 sheet 1 in column 1 sheet 2

    Captura.PNG

    should be

    Captura.PNG

    thanks

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

    Re: Two columns unique distinct values to listbox

    Please Login or Register  to view this content.
    Attached Files Attached Files

  15. #15
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: Two columns unique distinct values to listbox

    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    09-15-2018
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    18

    Re: Two columns unique distinct values to listbox

    Quote Originally Posted by jindon View Post
    Please Login or Register  to view this content.
    dont work , types fail

  17. #17
    Registered User
    Join Date
    09-15-2018
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    18

    Re: Two columns unique distinct values to listbox

    Quote Originally Posted by mohadin View Post
    Please Login or Register  to view this content.
    amaizing code thanks

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

    Re: Two columns unique distinct values to listbox

    Then you must change your profile telling exact excel version that you are using.

    It is working on O365.

  19. #19
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: Two columns unique distinct values to listbox

    Welcome any time

+ 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. unique-distinct-dependent-lists1-three-columns
    By Grace Tan in forum Excel Formulas & Functions
    Replies: 50
    Last Post: 03-16-2021, 03:40 AM
  2. Formula to extract unique values/distinct values in rows in excel
    By bjnockle in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-07-2020, 05:35 PM
  3. Replies: 0
    Last Post: 07-21-2015, 04:44 PM
  4. Create a Distinct Unique list for 2 Columns
    By boldcode in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-06-2014, 05:10 PM
  5. [SOLVED] Copy Unique Distinct Values
    By snapfade in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2013, 10:33 AM
  6. Is it possible to limit a listbox based on a range to only retrieve distinct values?
    By Gvsandrs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-15-2013, 11:58 AM
  7. Replies: 1
    Last Post: 03-02-2011, 04:14 PM

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