For i = 6 To Cells(Rows.Count, "I").End(xlUp).Row
If Cells(i, 9) = Range("ES2") Then Range(Cells(i, 4), Cells(i, 135)).Copy: Exit For
Next
If Range("ES1049") = 0 Then
ActiveSheet.Range("D1049").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Else
X = ActiveSheet.Range("D4049").End(xlUp).Row + 1
ActiveSheet.Range("D" & X).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End If
Application.CutCopyMode = False
End If