+ Reply to Thread
Results 1 to 5 of 5

VBA Excel adding dynamic validation list to multiple cells

  1. #1
    Registered User
    Join Date
    12-12-2016
    Location
    Mumbai, India
    MS-Off Ver
    2013
    Posts
    2

    VBA Excel adding dynamic validation list to multiple cells

    I have created two drop down list of country and city which are dependent using this:

    https://siddharthrout.wordpress.com/...ent-lists-vba/

    However, now the issue is that I would like to create similar drop-downs below it using the same code in the file.

    So I replaced Range("B2") with Range("B2:B11") and Range("C2") with Range("C2:C11") everywhere in the code.

    But this is now giving the error 'Type Mismatch' and therefore not generating the required output. I am not good in vba so I am not able to understand what else should I change. Any help is greatly appreciated!

    Also, for country Australia in cell B2 in sheet 1, it is showing Sydney and NSW separately which I want to be together.

    Thanks in advance!
    Attached Files Attached Files
    Last edited by Lokesh3_14; 12-22-2016 at 07:08 AM.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: VBA Excel adding dynamic validation list to multiple cells

    This is one of my favorite techniques for cascading drop-down lists. Check it out to see if it will work for you.
    http://www.utteraccess.com/wiki/inde...ists_%28VBA%29
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA Excel adding dynamic validation list to multiple cells

    Hi Lokesh3_14

    Welcome to the Forum!!!

    I didn't rewrite your existing Code, merely modified it. As dflak noted, there are other ways to do this...some better than others. Modified Code..
    Please Login or Register  to view this content.
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Registered User
    Join Date
    12-12-2016
    Location
    Mumbai, India
    MS-Off Ver
    2013
    Posts
    2

    Re: VBA Excel adding dynamic validation list to multiple cells

    Hi John,

    Thanks very much for your help! That worked like a charm for me. Sure I will mark my Thread as SOLVED.

    Kind Regards,
    Lokesh

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA Excel adding dynamic validation list to multiple cells

    You're welcome...glad I could help.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ 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. How to add Multiple Cells from Data Validation List
    By trumpetman in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-24-2014, 11:29 PM
  2. Adding Date Data Validation to cells with List Data Validation
    By biggtyme in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-03-2013, 09:47 AM
  3. Replies: 0
    Last Post: 04-15-2013, 09:22 AM
  4. Adding multiple cells based on the result of a data validation cell
    By ronrona96 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 01-20-2013, 12:19 AM
  5. Dynamic dropdown list via data validation in Excel
    By ronin21 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-22-2012, 07:01 AM
  6. Replies: 0
    Last Post: 02-13-2012, 07:18 AM
  7. Replies: 0
    Last Post: 10-31-2007, 05:20 AM

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