ExcelPadawan
New Member
- Joined
- Feb 25, 2015
- Messages
- 13
Hi guys, I have a macro running on a worksheet I am building. Right now it is set to clear a range of drop down list cells in one column based on a selection changing in a single drop down cell for that same column.
In this case it means if cell C11 is changed in any way, C19-C20 will automatically go blank. I would like this same formula applied for each column, so if D11 is changed in any way, D19-D30 will go blank, and so on and so forth.
Below is my current code:
Private Sub Worksheet_Change(ByVal target As Range)
Application.ScreenUpdating = False
If Intersect(target, Range("C11")) Is Nothing Then Exit Sub
Range("C19:C30").ClearContents
End Sub
I've been playing with this code and can't figure out how to apply it so it functions in the same way but independently for each column, so changes in C will only affect column C, changes in D will only affect column D, etc.
Please help, and thank you!
In this case it means if cell C11 is changed in any way, C19-C20 will automatically go blank. I would like this same formula applied for each column, so if D11 is changed in any way, D19-D30 will go blank, and so on and so forth.
Below is my current code:
Private Sub Worksheet_Change(ByVal target As Range)
Application.ScreenUpdating = False
If Intersect(target, Range("C11")) Is Nothing Then Exit Sub
Range("C19:C30").ClearContents
End Sub
I've been playing with this code and can't figure out how to apply it so it functions in the same way but independently for each column, so changes in C will only affect column C, changes in D will only affect column D, etc.
Please help, and thank you!