Forum Discussion
Saud
May 03, 2023Brass Contributor
drop list with check box
Hi All I have a column in an Excel page that has a drop-down list, but the problem is that the options may be more than one. Can I merge the check box with the drop-down list, so that more than o...
HansVogelaar
May 03, 2023MVP
See the attached version. It is now a macro-enabled workbook, so you will have to allow macros when you open the workbook.
To view the code, right-click the sheet tab and select 'View Code' from the context menu.
MKell099
May 09, 2024Copper Contributor
HansVogelaar Piggy-backing off this; hope no one minds.
This is great and works beautifully, but I have a question: what if I wanted two different lists to work like this. For instance, range C2:C101 would have the data validation range H2:H10 and range D2:D101 would have the data validation range I2:I15.
So, someone would select option(s) from the drop-down list in C3, and I'd like for them to have the ability to select more than one option from the range of H2:H10. Same thing with the drop-down list in D4.
VBA is not my strong suit, unfortunately. I'm much more proficient in JS, which at least gives me the base to understand what's happening in the code you provided, but not enough to expound upon it. I'd love a little help, if you wouldn't mind!
Thanks!
- HansVogelaarMay 09, 2024MVP
The only thing you need to change in the code is the range to be checked:
If Intersect(Range("C2:D101"), Target) Is Nothing Then Exit Sub
See the attached version.