Hi Friends

I have used for next to loop through range but I got subscript out of range

here is my code.

Code:
 Dim i As Long
    For i = 1 To Sheets("Sheet2").Range(A1, S1000).Rows
        If Sheets("Sheet1").Range("F5") = Cells(1, "R") Then
         Selection.Rows(i).EntireRow.Delete
        End If
    Next i
    Range("F22") = i
can any one help me what is the problem?

thanks