Clear adjacent cells when a cell is chaneged

  • In the attached workbook columns D - I have dynamic dependent drop-down lists. All of these drop-downs work as expected but I need to prevent user error by clearing adjacent cells when something is changed in any of the cells.


    Example: I need to clear adjacent cells if something changes in Column D or E. So if I select "Laptop" and them "Apple MacBook Pro 13-inch" and then I decide that I want a "Desktop" it will clear the "Apple MacBook Pro" selection or if I change the "Laptop"
    option to a "Lenovo ThinkPad T460: the"Preferred OS" will clear and/or anything else selected for that machine in columns F, G, H, I will clear.


    I had this working in a different workbook using


    Private Sub Worksheet_Change(ByVal Target As Range)



    If Not Intersect(Target, Range("D4:D137")) Is Nothing Then
    Target.Offset(0, 1).ClearContents
    ElseIf Not Intersect(Target, Range("C4:C137")) Is Nothing Then
    Target.Offset(0, 1).ClearContents
    Target.Offset(0, 2).ClearContents
    End If
    End Sub


    This same code does not seem to work in my new workbook.


    Any thoughts?

  • Re: Clear adjacent cells when a cell is chaneged


    Try this,
    Using Application.Intersect


  • Re: Clear adjacent cells when a cell is chaneged


    Thank you so much. This worked.



    Not sure where/how to mark this thread as resolved.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!