yousraemara
New Member
- Joined
- Feb 26, 2020
- Messages
- 1
- Office Version
- 365
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
- Platform
- Windows
Hi Everyone,
I am found a macro online that would allow to clear a dependent drop down list, but it doesn't work.
I have a parent list that is merged from M7 till O7 and then a list that is dependent on it and ranges from Q7 till S7.
I also have a list that is depenent on the list from Q7 till S7 and this list is from W7 till Y7. Can someone please help me with what is wrong with the code below:
Private Sub Worksheet_Change(ByVal Target As Range)
' If Target cell is merged cell M7:O7 then...
If Target.Address = "$M$7" Then
' Clear contents of merged cell Q7:S7
Target.Offset(7, 0).Value = ""
End If
' If Target cell is merged cell Q7:S7 then...
If Target.Address = "$Q$7" Then
' Clear contents of merged cell W7:Y7
Target.Offset(7, 0).Value = ""
End If
End Sub
I am found a macro online that would allow to clear a dependent drop down list, but it doesn't work.
I have a parent list that is merged from M7 till O7 and then a list that is dependent on it and ranges from Q7 till S7.
I also have a list that is depenent on the list from Q7 till S7 and this list is from W7 till Y7. Can someone please help me with what is wrong with the code below:
Private Sub Worksheet_Change(ByVal Target As Range)
' If Target cell is merged cell M7:O7 then...
If Target.Address = "$M$7" Then
' Clear contents of merged cell Q7:S7
Target.Offset(7, 0).Value = ""
End If
' If Target cell is merged cell Q7:S7 then...
If Target.Address = "$Q$7" Then
' Clear contents of merged cell W7:Y7
Target.Offset(7, 0).Value = ""
End If
End Sub