Hello Everyone,
This is my first time posting here, so right off I'd like to say thank you for all of the great questions and answers here that have helped me so much already. I'm quite new to VBA, so this has been a lifeline for me.
I am creating a template workbook with many tables which contain multiple dependent dropdown lists. These cascades appear to be working just fine in the tables via data validation using the INDIRECT function.
My challenge has been to create this same functionality in the userforms.
I have found several examples of code for similar situations to mine, but each one is just unique enough that I’m not able to recognize how to make it work for my particular use (yes, very new to VBA).
The Context:
To keep it simple, here are just some basic details for one of the tables…
I’ll call this the MAIN table, and it has 3 columns: 1. “Type” 2. “Subtype” 3. “Item”
1. The “Type” column has a drop-down list in it based on a single-column dynamic named range which is stored on a different sheet in the workbook.
2. The “Subtype” column is dependent on the user’s drop-down list choice in the “Type” column and it draws on dynamic named ranges with names that exactly match the options in the “Type” column list. (These ranges are also housed on that other worksheet.)
3. Similarly, the “Item” column is dependent on the user’s drop-down list choice in the “Subtype” column and draws on dynamic named ranges with names that exactly match the options in the “Subtype” column lists.
So all named ranges are dynamic, single-column, and are stored on a sheet named “DropDownLists”. (The ranges are directly based on named tables.)
The Userform:
1. The “Type” field is a combo box that has already been coded to show all items in the named range called “rgeMAINItemType”. That seems to be working fine.
Name: cboTypeMAIN
2. The “Subtype” field is a combo box that SHOULD BE populated by the range whose name matches the selection the user enters into cboTypeMAIN.
Name: cboSubtypeMAIN
3. The “Item” field is a combo box that SHOULD BE populated by the range whose name matches the selection the user enters into cboSubtypeMAIN.
Name: cboItemMAIN
I won’t post any of the code I have been trying, in order to not confuse the matter here. Also, I realize that there might be potentials for errors that one should address within the coding that I am just not aware of...
If anyone is able to assist me with a solution, it would be very greatly appreciated. (I have been working on this without success for a very long time!)
(Simple workbook example attached.)
Thank you very much!!
Bookmarks