The code in the most recent workbook features a Worksheet_Change event, so all sheet references are implied to the sheet the code is imbedded on.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Address <> "$B$2" Then Exit Sub
Application.EnableEvents = False
Range("A" & 7, Range("M" & Range("A" & Rows.Count).End(xlUp).Row)).ClearContents
For i = 2 To Sheets("Data").Range("A" & Rows.Count).End(xlUp).Row
For Each rngCell In Range("A" & i, Range("M" & i))
If InStr(1, rngCell, Sheets("Search").Range("B2")) > 0 Then
Sheets("Data").Range("A" & i, Sheets("Data").Range("M" & i)).Copy Sheets("Search").Range("A" & Rows.Count).End(xlUp).Offset(1)
Exit For
End If
Next
Next
Application.EnableEvents = True
End Sub
Bookmarks