VBA or v/x lookup to populate a table with data, based on selection of an adjacent dropdown?

Guitarmageddon

Board Regular
Joined
Dec 22, 2014
Messages
161
Hey folks, I have a survey form for the user to input scores on various criteria. One of the sections of the survey form however, is dependent on a particular area surveyed. This is something I want to identify with an adjacent dropdown. Once they click on something in the dropdown list (there are 4 choices), I want the requisite questions to populate for which the reviewer can now score.

Im not sure if we would bake those pre-set questions into the VBA code or just put on another tab that is hidden. I suppose hiding a tab is perfectly fine. Another though that occured to me is maybe just doing this with a vlookup of some sort?

here is the data. It is populated in b11 : b14. It should be driven by the dropdown choice of the different specified areas (1 thru 4), in the dropdown in C10. If you have a better way of specifying the data compared to this dropdown, then sure Im all ears.
1683647529874.png


The choices to select this data for b11:b14 will live in another sheet (I have it on "Sheet1") and it just looks like this:
1683646944088.png


Then based on the dropdown selection, it just fills the cells in the first image b11:b14. So in the example above, selecting AREA 2, it would fill those empty cells with AREA 2's specific survey questions to respond:
1683648252694.png
 

Attachments

  • 1683646668662.png
    1683646668662.png
    10.7 KB · Views: 12

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Ok well it seems this is one solution. Just when you insert the filter array function, it inserts another row of the choice you selected which can be kind of clunky, but I can just hide the column:

=FILTER(CHOICE_LIST,CHOICE_LIST[AREA]=D10,"NOTHING")

I used UNIQUE adjacent to my master list of questions to get a unique list of options. I then used that to drive the dropwdown selector for AREA. Then if "AREA xxx" in the filter function equals "AREA xxxx' of the dropdown, it returns the following questions. Simple enough, but maybe theres a more elegant way?
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,180
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top