Dim strsearch As String, lastline As Integer, tocopy As Integer strsearch = CStr(InputBox("enter the string to search for")) lastline = Range("A65536").End(xlUp).Row j = 1 For i = 1 To lastline For Each c In Range("A" & i & ":Z" & i) If InStr(c.Text, strsearch) Then tocopy = 1 End If Next c If tocopy = 1 Then Rows(i).Copy Destination:=Sheets(2).Rows(j) j = j + 1 End If tocopy = 0 Next i
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)