Q:

Error when copying row to another sheet

The code below brings up an error when trying to copy row over to new sheet.
The excel sheet has 3 sheets, info (data export), filter(string names), results(blank sheet)
The code is supposed to match substring from filter worksheet with main string on info worksheet. If the substring is contained in the main string, it will copy the entire row over to the results worksheet. The error comes up when it's trying to copy over. 
I could be overcomplicating the process, any help is greatly appreciated. Thanks in advance. 
Error: Run-time error '1004':
Application-defined or object-defined error
Sub RoundedRectangle1_Click()

Dim info As Range
Dim filter As Range
Dim results As Range

Set info = Worksheets("Info").Cells(4, 5)
Set filter = Worksheets("Filter").Cells(2, 1)
Set results = Worksheets("Results").Cells(1, 1)

Dim i, j, k As Integer

i = 0
j = 0
k = 0

Do While info.Offset(i, 0) <> ""

If InStr(1, LCase(info.Offset(i, 0)), LCase(filter.Offset(k, 0))) <> 0 Then
info.Offset(i, 0).EntireRow.Copy results.Cells(j, 1)
i = i + 1
j = j + 1
k = 0
Else
If filter.Offset(k, 0) = "" Then
i = i + 1
k = 0
Else
k = k + 1
End If
End If
Loop

End Sub

A:

This is happening because your var J is declared as 0. .Cells(0, 1) is a invalid cell. Adjust J's value to 1 to fix this.
Sub RoundedRectangle1_Click()

Dim info As Range
Dim filter As Range
Dim results As Range

Set info = Worksheets("Info").Cells(4, 5)
Set filter = Worksheets("Filter").Cells(2, 1)
Set results = Worksheets("Results").Cells(1, 1)

Dim i, j, k As Integer

i = 0
j = 1  'Error fixed here
k = 0

Do While info.Offset(i, 0) <> ""

If InStr(1, LCase(info.Offset(i, 0)), LCase(filter.Offset(k, 0))) <> 0 Then
info.Offset(i, 0).EntireRow.Copy results.Cells(j, 1)
i = i + 1
j = j + 1
k = 0
Else
If filter.Offset(k, 0) = "" Then
i = i + 1
k = 0
Else
k = k + 1
End If
End If
Loop

End Sub

