New to the forum and have a quick VBA question.
The specified target cell is a drop down validation box with text. If the user deletes the text in the target cell, I want to clear the formula in the corresponding cell that is 7 columns to the right. Here is the code I have now that does not work:
What changes do I need to make?![]()
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub If Target.Value = Cells(Rows.Count, "J").End(xlUp).Value Then On Error Resume Next Application.EnableEvents = False Dim rRange As Range Dim rRange2 As Range Set rRange = Target.Offset(0, 7) Set rRange2 = Target.Offset(-1, 7) rRange2.Copy rRange.PasteSpecial (xlPasteAll) Application.CutCopyMode = False Application.EnableEvents = True On Error GoTo 0 Else rRange.ClearContents End If End Sub
Any help much appreciated - Bob B
Bookmarks