Hi all,
I found the following VBA code to clear a dependent drop down menu entry when the independent drop down entry is changed:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A1")) Is Nothing Then
Range("B1").ClearContents
End If
End Sub
</pre>
It works perfectly when I change A1...B1 is cleared. However, I have independent drop down data in A1 through A100, and I need the code to work in each row. In other words, when I change A4, I want B4 (only) to clear while the rest of the rows/columns go unchanged. If I change A30, I want B30 to clear. Can someone please help me properly define the Range in the above code?
Thanks in advance for your time.
I found the following VBA code to clear a dependent drop down menu entry when the independent drop down entry is changed:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A1")) Is Nothing Then
Range("B1").ClearContents
End If
End Sub
</pre>
It works perfectly when I change A1...B1 is cleared. However, I have independent drop down data in A1 through A100, and I need the code to work in each row. In other words, when I change A4, I want B4 (only) to clear while the rest of the rows/columns go unchanged. If I change A30, I want B30 to clear. Can someone please help me properly define the Range in the above code?
Thanks in advance for your time.