+ Reply to Thread
Results 1 to 6 of 6

Dependent Dropdown list through VBA

  1. #1
    Forum Contributor
    Join Date
    11-24-2019
    Location
    India
    MS-Off Ver
    Ms. Office 2016
    Posts
    169

    Exclamation Dependent Dropdown list through VBA

    Hello Friends,
    I want enter data in a table through dependent dropdown list. It should work purely on vba code. It will be helpful if code use cell ranges instead of giving names of respective items in code. If any value in the cell range/reference changes, it should be changed automatically in the both dropdown list. It means code should automatically get updated with the change in the text in given reference. For reference sample sheet is attached.

    Thank you in advance....
    Attached Files Attached Files

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Dependent Dropdown list through VBA

    give the attached a trial - the table will extend by placing the Sr.No. in the next vacant cell immediately below the last row of the table.
    The comboboxes only appear within the table - there are only two comboboxes (one in each column)
    There are no on-sheet formula - no conditional formatting - no on-sheet data validation - the table is dynamic as are the comboboxes.
    Attached Files Attached Files
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Forum Contributor
    Join Date
    11-24-2019
    Location
    India
    MS-Off Ver
    Ms. Office 2016
    Posts
    169

    Re: Dependent Dropdown list through VBA

    Thanks for your reply. Its dependent dropdown working fine.
    But it only works for single row and not for other rows of the table. Also it operates only with the help of Mouse and not with keyboard.
    Thanks again for help.

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Dependent Dropdown list through VBA

    Did you not read the instruction - first place your Sr.No. in column 'A' - then click in adjacent cell (column 'B') you will note the 'structured table' expands dynamically.
    As the table expands so does the application of the dropdowns - it deliberately does not work outside of the table.
    How do you envisage it working without the mouse - what key-presses do you anticipate using for selection in the drop-down

  5. #5
    Forum Contributor
    Join Date
    11-24-2019
    Location
    India
    MS-Off Ver
    Ms. Office 2016
    Posts
    169
    Quote Originally Posted by torachan View Post
    Did you not read the instruction - first place your Sr.No. in column 'A' - then click in adjacent cell (column 'B') you will note the 'structured table' expands dynamically.
    As the table expands so does the application of the dropdowns - it deliberately does not work outside of the table.
    How do you envisage it working without the mouse - what key-presses do you anticipate using for selection in the drop-down
    Oh yes got it now. Thanks. Working fine. Just one more thing. Can you put one more thing? As i have large number of data to enter, it becomes easy with keyboard only. Can i dropdown combobox with down arrow or can it be automatically dropdown if i select it? Thanks

  6. #6
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: Dependent Dropdown list through VBA

    Another option:
    See if this version of dependent data validation suit you (check post 7):
    https://www.excelforum.com/excel-gen...ml#post5583005

    as it is a data validation not a combobox then you can press ALT+Down Arrow to show the list.
    Last edited by Akuini; 01-20-2022 at 04:47 AM.

+ 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. Dependent Dropdown list
    By hEINSTEIN in forum Excel General
    Replies: 1
    Last Post: 03-24-2021, 08:55 AM
  2. [SOLVED] how drop down list be dependent with information show by selecting dropdown list?
    By noelcjf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-11-2021, 07:36 PM
  3. [SOLVED] Dependent dropdown list
    By JeffLance in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-06-2021, 11:34 PM
  4. Dependent Dropdown List
    By rjcjason in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-07-2018, 10:51 AM
  5. Replies: 1
    Last Post: 06-04-2018, 06:16 PM
  6. Dependent dropdown list
    By Spikyd in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-15-2017, 08:09 AM
  7. Replies: 7
    Last Post: 11-21-2016, 04:40 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