+ Reply to Thread
Results 1 to 13 of 13

VBA - Dynamic Data Validation based on a category

  1. #1
    Registered User
    Join Date
    03-01-2020
    Location
    Paris
    MS-Off Ver
    Office 2016
    Posts
    28

    VBA - Dynamic Data Validation based on a category

    Hello All,

    I have 2 columns,1) Category 2) products.

    I Have another sheet where it has all the Category and I would like to create a VBA which will create a dropdown of all the products corresponding to each of these category.

    I have created a fixed list data validation VBA code before but this is dynamic and the list is based on category, so I would like to have your inputs on this problem.

    I have attached the excel to explain the problem

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: VBA - Dynamic Data Validation based on a category

    How would you like the display to be ?
    Have you had a look on Pivot Tables, see you file attached
    Attached Files Attached Files
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    03-01-2020
    Location
    Paris
    MS-Off Ver
    Office 2016
    Posts
    28

    Re: VBA - Dynamic Data Validation based on a category

    Thanks for the message.

    I would like to place a data Validation against those Category using Drop down list.

    The idea is that the users wil select one product for each of those category from the dropdown and I would like to have this done thru VBA

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: VBA - Dynamic Data Validation based on a category

    Can you send an Excel sample file with the sheet where you want the drop down values and menus

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

    Re: VBA - Dynamic Data Validation based on a category

    Hi shyam,

    If you have Spill functions in your newer version Excel, watch this and use them to solve this problem.
    https://www.excel-university.com/cre...-spill-ranges/
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Registered User
    Join Date
    03-01-2020
    Location
    Paris
    MS-Off Ver
    Office 2016
    Posts
    28

    Re: VBA - Dynamic Data Validation based on a category

    Thank you!

    I have attached the sheet, may be it can help you explain my problem better.

    the idea is to create a Data validation - Drop down list in VBA . The list will have all the products corresponding to the category.

    Please let me know if im not clear on the explanation
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-01-2020
    Location
    Paris
    MS-Off Ver
    Office 2016
    Posts
    28

    Re: VBA - Dynamic Data Validation based on a category

    Thanks, but I am looking for the solution in VBA.

  8. #8
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: VBA - Dynamic Data Validation based on a category

    See here a possibility, not so simple

    In sheet1's code put next code
    In sheet1 notice the table and the range named "MyList"
    You can add Categories underneath cell G10 , as much as you want
    Today, validation lists take care of new inputs in the table but do not care when items are deleted
    See file attached

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

  9. #9
    Registered User
    Join Date
    03-01-2020
    Location
    Paris
    MS-Off Ver
    Office 2016
    Posts
    28

    Re: VBA - Dynamic Data Validation based on a category

    Thanks, could you please explain me how and what we are doing here ? - still learning

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

    Re: VBA - Dynamic Data Validation based on a category

    Hi Shyam,

    See the attached where I used the video link above to do your problem. It uses the newer Dynamic Array (#Spill) functions.
    Dynamic Named Ranges using Spill.xlsx
    No VBA needed.

  11. #11
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: VBA - Dynamic Data Validation based on a category

    It uses the newer Dynamic Array (#Spill) functions
    Yes it looks nice and Contecture is doing a nice presentation to:
    https://www.contextures.com/exceldat...gYf62N3IIrB3hJ

    but not all Excels can get it ...!

  12. #12
    Registered User
    Join Date
    03-01-2020
    Location
    Paris
    MS-Off Ver
    Office 2016
    Posts
    28

    Re: VBA - Dynamic Data Validation based on a category

    Yes thats true. If In case I share the excel, it may or may not work

  13. #13
    Registered User
    Join Date
    03-01-2020
    Location
    Paris
    MS-Off Ver
    Office 2016
    Posts
    28

    Re: VBA - Dynamic Data Validation based on a category

    Hello Marvin,

    I requested for a VBA solution becuase the case I presented in this thread will be part of a VBA code im working.

    So I cant have a Macro and a non VBA solution for this alone.

    Thanks

+ 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] Query to Return Sum Based on Category in Dynamic List
    By BlueGem97 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-26-2017, 12:08 AM
  2. If statement based data validation? Dynamic data validation?
    By bjohnsonac in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-02-2014, 02:12 PM
  3. [SOLVED] Data Validation List to Return Variable/Dynamic Data based on Reference Table
    By dilbert1865 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-13-2014, 09:08 AM
  4. [SOLVED] Create Dynamic Data Validation List based upon Criteria
    By stubbsj in forum Excel General
    Replies: 6
    Last Post: 06-04-2012, 08:33 AM
  5. [SOLVED] Dynamic highlighting of portions of rows based on a category
    By Excelsi0r in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-18-2012, 06:59 PM
  6. Dynamic Range based on Data Validation
    By Dial1 in forum Excel General
    Replies: 3
    Last Post: 01-15-2010, 01:25 PM
  7. Dynamic Data Validation based on series in a single cell
    By ExcelLefty in forum Excel General
    Replies: 4
    Last Post: 09-29-2009, 08:45 AM

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