Reset dependent dropdown to "Please select" on change

juliecooper255

New Member
Joined
Apr 24, 2024
Messages
15
Office Version
  1. 365
Platform
  1. Windows
Hi!
I followed the instraction in the thread below but unsuccessfully. I suspect it could be because my drop down are linear rather than column.

Here is what I am trying to achieve:

Dropdown list in column D (all lines from D16) - When changed, reset all dropdowns in columns E,F,G,H to "Please Select"
Dropdown list in column E (all lines from E16) - When changed, reset all dropdowns in columns F,G,H to "Please Select"
Dropdown list in column F (all lines from F16)- When changed, reset all dropdowns in columns G,H to "Please Select"
Dropdown list in column G (all lines from G16)- When changed, reset all dropdowns in columns H to "Please Select"
 

Attachments

  • Screenshot 2024-04-15 124430.png
    Screenshot 2024-04-15 124430.png
    23.5 KB · Views: 10
Add the MsgBox line to check that the code is being triggered.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Long
MsgBox "I have been triggered"  '<<<<
    If Target.Cells.Count > 1 Then Exit Sub
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
So I can't run it as doesn't show in the options, am I missing something? It will only appear when the suntax is Sub Worksheet_Change(). Is there another way to run this code?

1714220297069.png
 
Upvote 0
The code, as with all Event codes, needs to be in the Worksheet Code Module to which it is applicable.
Not in a Module.
Double click the appropriate sheet name within the VBA editor project pane and paste the event code there.
It will then auto-run when its trigger event occurs.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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