I am trying to create a VBA code which copies into Sheet \"Results\" the data in the third column of the below tab when the criteria \"Lukas\" in the first column and \"Appl
Don't call your sub procedure Copy(). Call it anything else.
Choose a different destination or you are just going to overwrite the values you are transferring across.
Sub copyLukasAndApple()
Dim LastRow As Long, i As Long, ws2 as worksheet
with Worksheets("Sheet1")
LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
For i = 2 To LastRow
If .Cells(i, 1) = "Lukas" And .Cells(i, 2) = “Apple” Then
with workSheets("Sheet2")
.cells(.rows.count, "A").end(xlup).offset(1, 0) = _
Worksheets("Sheet1").Cells(i, 3).value
end with
End If
Next i
end with
End Sub