+ Reply to Thread
Results 1 to 7 of 7

Data Validation SOURCE - Unique and Distinct

  1. #1
    Registered User
    Join Date
    04-03-2017
    Location
    Manila, Philippines
    MS-Off Ver
    2016
    Posts
    10

    Data Validation SOURCE - Unique and Distinct

    Hey, guys. Here's the picture of what I'm trying to do;

    COLUMN 1 COLUMN 2
    Company A
    Company B
    Company C


    I need to use data validation for the COLUMN 2 values so that it would display only the UNIQUE values related to COLUMN 1 entities (I'm getting the data from a reference sheet - For example, company A has 5 countries (some repeating) in the reference sheet). I've recorded it manually however getting the source is kind of a challenge. I have no idea how to get the UNIQUE values into the choices for the data validation dropdowns.

    Here's the code;

    Please Login or Register  to view this content.
    Thanks in advance!
    Last edited by RedRepublic01; 04-17-2017 at 01:33 AM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,219

    Re: Data Validation SOURCE - Unique and Distinct

    Hi RedRepublic,

    I did this problem this morning for another person. I think it is the same question. Look at this thread where Glenn and I answered it.

    https://www.excelforum.com/excel-for...wing-list.html

    If the above problem doesn't help then keep asking.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    04-03-2017
    Location
    Manila, Philippines
    MS-Off Ver
    2016
    Posts
    10

    Re: Data Validation SOURCE - Unique and Distinct

    Hello MarvinP,

    I've checked the macro and what it does is that it filters ALL unique values in a single column. However, what I need is to filter unique values in a single column that are related to a value in another column.

    For example; (IN MY REFERENCE SHEET)

    COLUMN1 COLUMN2
    Company A Columbia
    Company C Germany
    Company B Columbia
    Company A Mexico


    What I'm having trouble with is extracting unique values in the COLUMN2 that are related to a certain value (ex, Company A)

    (For some reason, the reply button isn't working so I used the quick reply)

    Thanks anyway, MarvinP :D

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,219

    Re: Data Validation SOURCE - Unique and Distinct

    OK RedRepublic,

    I did a problem like this a week ago. The OP wanted to do similar things (I think). See the attached where I build a dropdown list using a double click event in column B. I used Dynamic Named Ranges to do this one.
    See if this is close to what you need.

    Cascading Dropdowns using Advanced Filter.xlsm

  5. #5
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: Data Validation SOURCE - Unique and Distinct

    As you are using VBA so you may use combobox for that with below code :
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-03-2017
    Location
    Manila, Philippines
    MS-Off Ver
    2016
    Posts
    10

    Re: Data Validation SOURCE - Unique and Distinct

    Hi sanram,

    I need to store the values in dynamic cells. I can't use a combobox for it.

    @MarvinP,
    I've been studying your latest xlsm and it's just what I needed. I'm going deeper into analyzing how it works and configuring it to suit my needs. A very big help indeed. Thanks so much! ^_^

  7. #7
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: Data Validation SOURCE - Unique and Distinct

    You can link a combobox to a dynamic cell. So, it's no matter to store values in dynamic cells.

+ 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] counting unique/distinct values (sample data attached)
    By justinhampton81 in forum Excel General
    Replies: 9
    Last Post: 08-06-2014, 12:41 AM
  2. Need to find unique value only from the source data
    By vikrant1 in forum Excel General
    Replies: 1
    Last Post: 07-12-2012, 06:06 PM
  3. Replies: 1
    Last Post: 03-02-2011, 04:14 PM
  4. unique distinct counts.
    By albert28 in forum Excel General
    Replies: 2
    Last Post: 03-11-2010, 06:58 AM
  5. Need help in getting the unique distinct counts.
    By albert28 in forum Excel General
    Replies: 1
    Last Post: 03-11-2010, 05:48 AM
  6. data validation-Can the source of the validation criteria be dfrom a different sheet?
    By yael pinkert in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-07-2009, 04:28 AM
  7. Data Validation Returning only distinct values from a list
    By JI in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-28-2006, 06:45 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