This code isn't working. I have it in a module. I get the "Compile Error: Sub or Function not defined"

Sub Copyrowsandpaste()

Workbooks("P&L data macro").Worksheets("wobid").Activate
LastRow = Count(Range("A"))
For i = 2 To LastRow
    j = j + 1
    If Range("S" & i) = "Completed" Then
        Range("S" & i).EntireRow.Copy Worksheets("RES").Range("A" & j).Offset(1, 0)
    End If
Next i
End Sub
Please Help!

Thank you