VBA- Clear Dropdown List and Start in 1st Postion

Grimm127

Board Regular
Joined
Aug 17, 2011
Messages
132
Hi All you Guru's,

I need a little help.

I have 5 Dependent drop down Lists. Created from the Data Validation. I would like to reset the selections once the user decides to do another selection. I created this code below. The idea is the if the user makes the 5 selections and if he chooses to start over he can go to the top Dropdown select another option and it would reset the other drop downs to the first positions. If the 1st drop down is doesn't change and user selects to change the 2nd drop down the other 3 drop down fields reset to 1st position so on and so forth. It works an it doesn't Please help.


Code:
Private Sub Worksheet_Change_DD1(ByVal Target As Range)
    
    Application.EnableEvents = False
        If Target.Address = "$A$1" And Target.Validation.Type = 3 Then
            Target.Offset(1, 0).Value = "SPORT"
            Target.Offset(2, 0).Value = "ALL"
            Target.Offset(3, 0).Value = "ALL"
            Target.Offset(4, 0).Value = "ALL"
    End If
    Application.EnableEvents = True

End Sub

Private Sub Worksheet_Change_DD2(ByVal Target As Range)
 
    Application.EnableEvents = False
    If Target.Address = "$A$2" And Target.Validation.Type = 3 Then
        Target.Offset(1, 0).Value = "ALL"
        Target.Offset(2, 0).Value = "ALL"
        Target.Offset(3, 0).Value = "ALL"
    End If
    Application.EnableEvents = True

End Sub

Private Sub Worksheet_Change_DD3(ByVal Target As Range)
   
    Application.EnableEvents = False
    If Target.Address = "$A$3" And Target.Validation.Type = 3 Then
        Target.Offset(1, 0).Value = "ALL"
        Target.Offset(2, 0).Value = "ALL"
    End If
    Application.EnableEvents = True

End Sub
Private Sub Worksheet_Change_DD4(ByVal Target As Range)
   
    Application.EnableEvents = False
    If Target.Address = "$A$4" And Target.Validation.Type = 3 Then
        Target.Offset(1, 0).Value = "ALL"
    End If
    Application.EnableEvents = True

End Sub
 
Last edited by a moderator:

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Is this what you're after?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
   If Target.CountLarge > 1 Then Exit Sub
   Application.EnableEvents = False
   If Target.Address = "$A$1" And Target.Validation.Type = 3 Then
      Target.Offset(1, 0).Value = "SPORT"
      Target.Offset(2, 0).Value = "ALL"
      Target.Offset(3, 0).Value = "ALL"
      Target.Offset(4, 0).Value = "ALL"
   ElseIf Target.Address = "$A$2" And Target.Validation.Type = 3 Then
      Target.Offset(1, 0).Value = "ALL"
      Target.Offset(2, 0).Value = "ALL"
      Target.Offset(3, 0).Value = "ALL"
   ElseIf Target.Address = "$A$3" And Target.Validation.Type = 3 Then
      Target.Offset(1, 0).Value = "ALL"
      Target.Offset(2, 0).Value = "ALL"
   ElseIf Target.Address = "$A$4" And Target.Validation.Type = 3 Then
      Target.Offset(1, 0).Value = "ALL"
   End If
   Application.EnableEvents = True
End Sub
 
Upvote 0
@Fluff,
Its perfect! Thank you! I couldn't picture in my head to set it up but now thanks to you it works great! Thank you again!
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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