Forum Discussion
Autopopulate a drop down from another drop down
- Nov 15, 2021
See the attached version. It uses a combination of Data Validation and VBA (in the worksheet module).
See the attached version. It uses a combination of Data Validation and VBA (in the worksheet module).
- bsiemensJan 02, 2025Copper Contributor
This is exactly what I'm trying to do but I'm having difficulty with the formula. I'm not sure how to use IF, VLOOKUP, etc.
- HansVogelaarJan 02, 2025MVP
Please download the sample workbook from my first reply.
Right-click the sheet tab of the first sheet and select View Code from the context menu to see the VBA code used.
- bsiemensJan 02, 2025Copper Contributor
I think coding might be a little advanced for me! lol
- M2021LNov 15, 2021Copper Contributor
HansVogelaar This is exactly what I wanted! Thank you so much.
How do go about setting it up on a different workbook?
- HansVogelaarNov 15, 2021MVP
You'll need to copy the code from the worksheet module *) to the worksheet module of the sheet you want to apply it to, and modify the code according to the exact setup you have.
*) Right-click the sheet tab and select View Code from the context menu to activate the Visual Basic Editor and view the worksheet module.
I used named ranges for the data validation rules. See Formulas > Name Manager.
- M2021LNov 15, 2021Copper Contributor
Thank you for your reply.
For the following line of code, I understand that I need to change 'Result' as this is showing up as an error but what do I change it to as I have several possible drop downs that will apply to different columns.
.Add Type:=xlValidateList, Formula1:="=Result"
Similar to the your example, I have several columns that need autopopulating (i.e. Result 1, Result 2, Result 3 etc) however, each have a different drop down menu.
Thanks