I have been able to find a code to clear dependent drop down lists. However I'm not sure how to combine two commands. I have it set to currently clear the contents of E, F, and G if columns D, E, F, or G are changed. The code I'm using for this is below and works fine.
However I want a separate command that has column B and C cleared if A is changed, and column C cleared if B is changed.
However I want a separate command that has column B and C cleared if A is changed, and column C cleared if B is changed.
Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
'clear contents of dependent cells
On Error Resume Next
If Target.Validation.Type = 3 Then
Application.EnableEvents = False
Select Case Target.Column
Case 4 'clear columns E and F and G
Range(Target.Offset(0, 1), _
Target.Offset(0, 3)).ClearContents
Case 5 'clear column F and G
Range(Target.Offset(0, 1), _
Target.Offset(0, 2)).ClearContents
Case 6 'clear column G
Target.Offset(0, 1).ClearContents
End Select
End If
exitHandler:
Application.EnableEvents = True
Exit Sub
End Sub