drop down list dependence on other cell

bobmc

Board Regular
Joined
Mar 13, 2002
Messages
142
Hello...

Cells B1 and B2 are validation drop down lists derived from ranges D2:D4 and E2:E4 respectively.

Let's say the only shape available in the color "Green" is "Triangle". If "Green" is selected, I'd like cell B2's dropdown to either default to "Triangle" without any other option available, or have cell B2 display a message to the effect, "Green is only available in Triangle.".

Any ideas?

Thanks

bobmc
Book2
ABCDE
1ColorGreenColorsShapes
2ShapeSquareBlueRound
3RedSquare
4GreenTriangle
Sheet1
 
Thank you Damon!

Your VB code works perfectly on my mockup with the countries. Now I'll adapt accordingly. You VB'ers are brilliant! I might actually have to learn it!

bobmc
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
A note to Aladin,

You're right (as always!), I could have used a combination of VBA event code and worksheet-based methods (such as dynamic named ranges) rather than doing the entire job in VBA. I guess the only part that had to be implemented in VBA is the part that clears the dependent cell.

Also, where I have the code [City].ClearContents could have been code that reformats the cell color or font, or makes the cell blink, etc. The only problem with this is that then extra code must be added to set it back when the user again enters data in the cell by selecting an item from the list.

Damon
 
Upvote 0

Forum statistics

Threads
1,216,860
Messages
6,133,108
Members
449,778
Latest member
dep1969

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