Macro to select a value from a validation list

EldrckTW

New Member
Joined
Mar 10, 2008
Messages
34
Hi people smarter than me :)!

I've got a very complex sheet with a ton of validation lists. These lists have many dependent variables, and when it comes time to select from a specific list, there are usually only 1-2 options to choose from.

I would like to create a macro (or some other solution) that selects the first value in the validation list when only 1 value exists to be chosen. This would save the user A TON! of time populating this sheet as hundrends of validation lists could be on here.

My only idea was to write a formula (not VBA) in the Validation list cell that had the same rules as the Validation List to display a value if one option was shown. As there are tons of depenedent variables....this would mean writing a lot of multi-celled formulas (multi-celled because the IF statements would be longer than Excel would allow).

Any ideas? Appreciate the help!
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Actually, you said the "drop down" in the final cell usually only had one or two options. What is that DV formula?

You should be able to put a "cell" version of that formula in a cell with an IF/THEN that counts the number of options in the resulting array.

In this simple example, the first named range NM1 only has one item in it, the next has 3. The final formula out in H3 shows how you can test that and display that one option using just a formula.

Excel Workbook
ABCDEFGH
11 cell rng3-cell rng
2Name:EntriesFormula
3catbirdNm11cat
4dogNm23
5cat
6
Sheet1
 
Upvote 0

Forum statistics

Threads
1,223,101
Messages
6,170,116
Members
452,302
Latest member
TaMere

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