how to update Options under a drop down list when a linked drop down list is changed?

hrithik

Active Member
Joined
Jul 26, 2010
Messages
336
I have a drop down list in $A$1 with options (fruits, Cake, Drinks)

Another drop down list in $B$1 shows these groups {apple, orange}, {cheese,chocolate}, and {soda,water} depending on the option selected in $A$1.

I'm using name ranges and Indirect() to link these two drop downs.

The problem I face is;
Firstly "fruits" is selected in $A$1 and "apple" in $B$1
Now if I select "Drinks" in $A$1, $B$1 still shows "apple".
I want $B$1 to update itself automatically whenever $A$1 cell is changed.

Is this possible?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

AlphaFrog

MrExcel MVP
Joined
Sep 2, 2009
Messages
16,451
Right-click on the sheet tab with the drop-down lists. Select "View Code" from the pop-up menu. Paste the code below in the VBA edit window.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Address = "$A$1" Then Range("B1").ClearContents
    
End Sub
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,113
Messages
5,857,453
Members
431,880
Latest member
kar2rost

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
Top