+ Reply to Thread
Results 1 to 25 of 25

Data validation List based on another DV list

  1. #1
    Registered User
    Join Date
    06-25-2022
    Location
    Madagascar
    MS-Off Ver
    2013
    Posts
    15

    Data validation List based on another DV list

    Hello Everyone,

    I need help to make a function to create a validation list based on another validation list text selected.

    Please find attached the excel file with the information on sheet 3 (Sells) about the function i need.

    Sheet 1:
    I have my DB with a table of "ProductType"

    Sheet 2:
    I have my stocks with a column of list "ProductType" that i can select, and another column with the description of the product.

    Sheet 3:
    I have a selectable list of the Product type based on the "ProductType" table on sheet 1.
    I have another column "Product List" in which i want to put a data validation list based on the product type selected on the "ProductList" column.

    Please help me to find a function to resolve my issue.

    Thank you

    Regards,
    Vij401
    Attached Files Attached Files

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,643

    Re: Data validation List based on another DV list

    Hi
    perhaps https://www.contextures.com/xldataval02.html

  3. #3
    Registered User
    Join Date
    06-25-2022
    Location
    Madagascar
    MS-Off Ver
    2013
    Posts
    15

    Re: Data validation List based on another DV list

    Hi,

    I tried all the solutions presented on the link but i'm not able to make what i need.
    Please help me with the function.

    Thank you by advance.

  4. #4
    Registered User
    Join Date
    06-22-2022
    Location
    India
    MS-Off Ver
    Microsoft office Home and Student 2019
    Posts
    61

    Re: Data validation List based on another DV list

    Hi,

    Find the attached sheet with your requirement.
    Note: In Sheet2(Stock) I have rearranged the Product Type and Description in the range D to G(green Highlighted portion)
    to facilitate the data validation list. Do not delete that portion as it is linked to the list.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-25-2022
    Location
    Madagascar
    MS-Off Ver
    2013
    Posts
    15

    Re: Data validation List based on another DV list

    Hello,

    Thank you for giving me this solution.
    Unfortunately, i can't use this solution because here i have to create a new table and i have thousands of different products description, so it will be difficult to manage it.
    Is there any other solution to make the same without creating this new "green" table ?

    Thanks & Regards.

  6. #6
    Registered User
    Join Date
    06-22-2022
    Location
    India
    MS-Off Ver
    Microsoft office Home and Student 2019
    Posts
    61

    Re: Data validation List based on another DV list

    Hi,
    The Green region has formula that derives all the product description based on the mentioned Product type.
    I have updated the formula in the Green region for accommodating 500 rows of data also have dragged the formula till D500:G500.You may drag it further if required.
    As an example, I have added sample data by adding a number at the end of the Product Description to display in the list.
    You can add data in the Column A and B in Sheet2(Stock) and drag the formula correspondingly in Col D:G
    Note :I have also added the formula that is fed in the data validation for your reference in Sheet3(Sells) Cell F2.
    Check if this version to meets your requirements.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    06-25-2022
    Location
    Madagascar
    MS-Off Ver
    2013
    Posts
    15

    Re: Data validation List based on another DV list

    Hi HariArvi,

    I understand your solution and i thank you for that, but i need a solution without creating any other table.
    I want to create the dynamic DV list on Sells Sheet based on the new line created on the table of Stock Sheet.
    Is there any solution by adding directly a formula on Sells Cell "Product List" ?

    Thank you for your help.

  8. #8
    Registered User
    Join Date
    06-22-2022
    Location
    India
    MS-Off Ver
    Microsoft office Home and Student 2019
    Posts
    61

    Re: Data validation List based on another DV list

    Hi,

    I have updated the sheet for DV list in Sells without Supporting table.
    Note: The table in the Stock sheet needs to be sorted once you add any data.
    Hope this satisfy your requirement.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    06-25-2022
    Location
    Madagascar
    MS-Off Ver
    2013
    Posts
    15

    Re: Data validation List based on another DV list

    Hi,

    This is indeed the type solution i needed.
    But there is no solution to make it without sorting the Stock table ?

    Thank you

  10. #10
    Registered User
    Join Date
    06-22-2022
    Location
    India
    MS-Off Ver
    Microsoft office Home and Student 2019
    Posts
    61

    Re: Data validation List based on another DV list

    Hi,

    The formula works only when the table is sorted.

  11. #11
    Registered User
    Join Date
    06-25-2022
    Location
    Madagascar
    MS-Off Ver
    2013
    Posts
    15

    Re: Data validation List based on another DV list

    Hi,

    Yes i understand that.
    Is that mean we have not any other solution ?

    Thank you

  12. #12
    Registered User
    Join Date
    06-22-2022
    Location
    India
    MS-Off Ver
    Microsoft office Home and Student 2019
    Posts
    61

    Re: Data validation List based on another DV list

    With the experience that I have, this is the solution I am aware of.

  13. #13
    Registered User
    Join Date
    06-25-2022
    Location
    Madagascar
    MS-Off Ver
    2013
    Posts
    15

    Re: Data validation List based on another DV list

    Thank you for this solution.

    If anyone else have a solution without sorting the table it will help.

  14. #14
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Data validation List based on another DV list

    If you have Office 365 then you can use this in E2 (copied down):

    =TRANSPOSE(FILTER(Stock[Decription Product],Stock[Product Type]=Sells[@[Product Type]]))

    Then for the Data Validation in C2 use:

    =$E2#

    I don't think you can have a dynamic array for data validation without creating the reference somewhere.

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

    Re: Data validation List based on another DV list

    If you are Ok with worksheet event ,VBA code. No formula ,no table.
    Pl see the ranges. Adjust as required.
    Code for worksheet event
    Please Login or Register  to view this content.
    How to use the code
    Right click on Sheet tab --> view code
    Visual Basic (VB) window opens.
    Paste the code
    Close the VB window.
    Save the file as .xlsm
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 06-28-2022 at 11:41 AM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  16. #16
    Registered User
    Join Date
    06-25-2022
    Location
    Madagascar
    MS-Off Ver
    2013
    Posts
    15

    Re: Data validation List based on another DV list

    Hello,

    I don't have problem to use VBA code if that's the only solution possible with MS Office Excel 2013.
    However, on your solution i have a little issue.
    When i add a new line, the Product List is not filled automatically with the Stock Product Description. To make it fill, i have to manually change the range(C2:C4) to range(C2:C5) on your code.
    And if i put range more than the existing table or the even if i create a bigger table, i have an error on the code.
    Could you please verify and send me a dynamic solution?

    E.g:
    1) If i add date and product type on line 5, and i click on C5, i should see the product list associated to product type automatically without going on code to change the range.
    2) If i add date on line 5 but not yet the product type, and i click on Product list, there should be no error. And after if i add the product type, the process should be as 1).

    I hope it's clear.
    Sorry but English language is not my first language

    Thank you for your help
    Regards,
    Vij401

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

    Re: Data validation List based on another DV list

    Try this code:
    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    06-25-2022
    Location
    Madagascar
    MS-Off Ver
    2013
    Posts
    15

    Re: Data validation List based on another DV list

    Hi,

    The product list fill now automatically without having to change the code.
    But we have two kind of errors ;
    1) When we add a new line, but the "Product Type" is not yet selected and i click on Product List cell of that product tpye, i have a Error 1104 on the code.
    2) Same if i click on a empty cell of Product List column, in which i don't even extended yet the table, i have an error also.

    Please give me a solution in which i don't have this error.

    Thank you by advance.

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

    Re: Data validation List based on another DV list

    Try this
    Please Login or Register  to view this content.

  20. #20
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Data validation List based on another DV list

    Don't know about your situation.
    Please review some posts in my signature, it's may help.

    Regards.

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

    Re: Data validation List based on another DV list

    Further modified code.
    Please Login or Register  to view this content.

  22. #22
    Registered User
    Join Date
    06-25-2022
    Location
    Madagascar
    MS-Off Ver
    2013
    Posts
    15

    Thumbs up Re: Data validation List based on another DV list

    Hi,

    Sorry i change my response because i have a little issue.
    On my real file, i also have some Product on "Product List" with comma ","
    E.g.
    Product Type Product List
    Laptop Asus X5130, 16Gb Ram, 256 SSD, etc


    For that i see on Sells
    Product List
    Asus X5130
    16Gb Ram
    256 SSD
    etc

    It's like splitted into 4 row.

    Could you please advise on a solution for this?
    I assure you this will be the last time! ;p

    Thank you
    Last edited by vij401; 06-29-2022 at 08:22 AM.

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

    Re: Data validation List based on another DV list

    Pl upload file with the data as explained and how you want result.
    Is it possible to replace with "_".
    Last edited by kvsrinivasamurthy; 06-29-2022 at 11:33 AM.

  24. #24
    Registered User
    Join Date
    06-25-2022
    Location
    Madagascar
    MS-Off Ver
    2013
    Posts
    15

    Thumbs up Re: Data validation List based on another DV list

    Hi,

    It's ok i will use ";" instead of ",".
    Thank you for your help

    This post can be close (i don't know how to close it, it's my first post).

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

    Re: Data validation List based on another DV list

    Thanks for the feedback and rep.
    It is available in FAQ.

    To mark your thread solved do the following:
    New Method
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

    Old Method
    - Go to the first post
    - Click edit
    - Click Advance
    - Just below the word "Title:" you will see a dropdown with the word No prefix.
    - Change to Solve
    - Click Save

+ 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. Replies: 5
    Last Post: 06-28-2020, 11:35 AM
  2. Replies: 1
    Last Post: 01-14-2018, 11:04 AM
  3. Auto-Generate List from reference cells based on data validation list selection
    By BoundCustomDesign in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-13-2014, 11:06 AM
  4. Dependant ActiveX Combo Box list based on Data Validation List
    By spalmer28 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-12-2014, 07:57 AM
  5. Replies: 0
    Last Post: 01-09-2013, 11:44 AM
  6. Replies: 3
    Last Post: 07-20-2012, 09:52 AM
  7. Replies: 3
    Last Post: 04-11-2011, 05:52 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