+ Reply to Thread
Results 1 to 3 of 3

How can I add a new item to a dynamic validation list without adding to source table

  1. #1
    Registered User
    Join Date
    02-24-2019
    Location
    UK
    MS-Off Ver
    MS 365 PC & Mac (assume PC unless otherwise stated in post)
    Posts
    96

    How can I add a new item to a dynamic validation list without adding to source table

    Hi All, hope this is possible and appreciate your help.

    I currently have a table example below

    Supplier Product
    A Apple
    A Banana
    B Orange
    B Grape
    B Carrot
    C Pepper
    C Onion

    I have then used OFFSET function in a Named Range (I have called this 'dynamic_list') to generate dynamic Validation list for example when the user selects supplier B in an earlier cell my product validation list only shows Orange, Grape and Carrot.

    What I want to do is also add another option to the validation list "Product not listed".

    I know this can be achieved by altering the table as follows

    Supplier Product
    A Apple
    A Banana
    A Product not listed
    B Orange
    B Grape
    B Product not listed
    B Carrot
    C Pepper
    C Onion
    C Product not listed

    But when dealing with large number of suppliers it will get messy and may be forgotten when adding a new supplier.

    I had hoped I could achieve it by editing the validation source from =dynamic_list to something like =dynamic_list;"Product not listed" so this new option would be added to every list, but it does not work. Any ideas how I can achieve this without having to alter the source table as I have described.

    Chris

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: How can I add a new item to a dynamic validation list without adding to source table

    not sure on the feasibility of a formula based approach given restrictions on DV (intersections etc)

    if feasible, another option would be to use a change event and effectively allow the "exception" through
    edit: so, important caveat, what this means is - it does not add this default as an option to the DV list itself but, rather, it allows the user to type in Product Not Listed without raising an exception

    to illustrate - right click on sheet holding the DV list, and paste below into resulting window
    note:
    -- you must modify rngDV to be wherever the related DV cells are (below is simply set to Column E)
    -- you need to disable your error alert on the DV itself, and rely instead on error trap in below code (so, again, modify per own requirement - i.e. aping whatever you had in your DV error msg)

    Please Login or Register  to view this content.
    Last edited by XLent; 04-17-2020 at 07:42 AM.

  3. #3
    Registered User
    Join Date
    02-24-2019
    Location
    UK
    MS-Off Ver
    MS 365 PC & Mac (assume PC unless otherwise stated in post)
    Posts
    96

    Re: How can I add a new item to a dynamic validation list without adding to source table

    Hi XLent

    Thank you for the response and taking the time time to help me out, unfortunately I could not get it to work, however from my understanding your solution would require user to type in 'Product not listed' rather than it being presented as an option in a drop down list.

    I have since come up with another less sophisticated workaround, which actually works well.

    Basically I created a dynamic list on a separate sheet where the first entry is a simple INDEX, MATCH based on the supplier selected, subsequent rows continue to populate until the row number exceeds the COUNT of instances the supplier is mentioned. When this limit is reached, I just use IF statement to add 'Product not listed' as final option. I then redirect the named range to look at this list rather than the original source table.

+ 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: 6
    Last Post: 06-23-2019, 11:07 PM
  2. [SOLVED] not showing duplicates in data validation list from dynamic table
    By jaryszek in forum Excel General
    Replies: 26
    Last Post: 08-14-2018, 03:12 AM
  3. [SOLVED] VBA Excel adding dynamic validation list to multiple cells
    By Lokesh3_14 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-22-2016, 11:20 AM
  4. Dynamic Data Validation List Using Pivot Table
    By seethesun in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 05-05-2016, 11:02 AM
  5. Dynamic Validation List from DB Like Table
    By codewalk3r in forum Excel General
    Replies: 3
    Last Post: 09-02-2015, 10:16 AM
  6. Replies: 5
    Last Post: 07-29-2015, 08:36 AM
  7. Select item of a dropdown list (data validation) and refresh one pivot table
    By ATN123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2014, 07:40 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