+ Reply to Thread
Results 1 to 7 of 7

Auto update DV list with dynamic values

  1. #1
    Registered User
    Join Date
    07-31-2015
    Location
    broome
    MS-Off Ver
    2013
    Posts
    3

    Auto update DV list with dynamic values

    I have a Data Validation list whose options are derived from other cells and wish to have the value of the selection update automatically upon change. Let's say I have a DV list at A1 which references a list B1:B3. The values in B1:B3 are derived from the values at C1:C3 (B1 =C1 etc.). Changing a value in C3 will update the DV list but not the flat value in A1, it has to be selected manually. I can use VBA to get the value auto updated with a direct change in B1:B3 but not with a change at C1:C3, the change is not detected.

    Any thoughts?
    Thanks!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Auto update DV list with dynamic values

    Data Validation - Replace Selection with Formula To allow DV list updating
    This is a VBA solution that watches for you to make a selection from a drop down data validation list, then replaces that choice with a formula that resolves to the same value selected. Why? So you can later go to your data validation source list and "edit" it and the edit will flow to all the cells that use that value. So you could edit an item in the list from "dog" to "dogs" and all the other cells that originally selected "dog" would now show "dogs".

    Replace Prior DV Choices

    There is a sample sheet where you can test this technique out and see it in action.
    Last edited by JBeaucaire; 12-26-2019 at 04:13 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-31-2015
    Location
    broome
    MS-Off Ver
    2013
    Posts
    3

    Re: Auto update DV list with dynamic values

    Thank you JB, I have messed with your code already. The problem is that the list needs to be changed directly in order for your code to work. If the value of "Dog" comes from a cell outside of the list, the choice will not update automatically. Do you have a suggestion as to how the choice can detect a change to the list when it is not directly changed?

    Thanks.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Auto update DV list with dynamic values

    That is not correct. Since my macro replaces DV choices with a FORMULA that is pulling an indexed option from the current source list, regardless of how the source list is generated, by hand or by formulas, the other formulas that reference that list will always show results based on the current list.

    So as I understand your question, "How to have cells with a drop DV list update prior choices when the source DV options change?" will absolutely work with the suggested approach.

    If you're certain it won't work, that I don't understand, so you'll have to show me in a workbook how my solution fails to work.

  5. #5
    Registered User
    Join Date
    07-31-2015
    Location
    broome
    MS-Off Ver
    2013
    Posts
    3

    Re: Auto update DV list with dynamic values

    Thanks JB, you are absolutely correct, I jumped to a conclusion.
    In the first test file attached I have made a simulation and it works as advertised.
    Choose from the DV at A1 then change the corresponding row in column C and A1 updates.

    In test2 I have managed to duplicate the non updating thing I am experiencing, my brain is not big enough to work out why. Maybe yours is

    The DV in A12 chooses from the range G3:G7. Let's choose the first in the list (=G3).
    Choose another option from the DV at A3 (which changes G3) and you will see that A12 does not update.
    Look at the list in A12 and you will see the value has changed there but A12 retains the old value.

    I apologise for jumping to a conclusion and appreciate any ideas you may be able to provide to enlighten me!


    test.xlsm
    test2.xlsm

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Auto update DV list with dynamic values

    Both your test and test2 files are working the same for me.

  7. #7
    Registered User
    Join Date
    03-24-2023
    Location
    London, UK
    MS-Off Ver
    Home & Student 2021
    Posts
    1

    Re: Auto update DV list with dynamic values

    Thanks for sharing the example files, the Google sites link seems to be broken now.

    After a bit of head scratching, I've managed to get this working with DV where the source list is on the same worksheet as the cell with the DV applied.

    My question is, is there a way to get this working between sheets?

+ 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. Auto update List
    By isameer247 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-29-2015, 02:52 AM
  2. [SOLVED] Auto update a list I can select from
    By tlacloche in forum Excel General
    Replies: 7
    Last Post: 05-03-2014, 10:51 AM
  3. [SOLVED] Dynamic chart title created in VBA does not auto-update
    By DH112213 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2013, 12:38 PM
  4. Auto extend and update list
    By Jactey in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-21-2012, 04:21 AM
  5. auto update validation list.
    By Jurado01 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-12-2009, 11:23 AM
  6. UPdate Dynamic List
    By Zandra in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-06-2009, 12:40 PM
  7. Auto Update A Validation List
    By Dmorri254 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-03-2005, 04:06 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