Public Sub GPE()
Dim dArr(1 To 1000, 1 To 4), sArr, I As Long, K As Long, J As Long, R As Long, Ws As Worksheet
Dim TySi As String, Le As Long, Z
TySi = Sheet1.[E3].Value: Le = Sheet1.[F3].Value
For Each Ws In Worksheets
If Ws.Name Like "cutting list*" Then
sArr = Ws.Range("C9", Ws.Range("C" & Rows.Count).End(3)).Resize(, 13).Value
For I = 1 To UBound(sArr)
If sArr(I, 1) = TySi Then
If sArr(I, 12) = Le Then
K = K + 1
dArr(K, 1) = sArr(I, 13)
dArr(K, 2) = sArr(I, 11)
End If
If sArr(I, 3) = Le Then
R = R + 1
dArr(R, 3) = sArr(I, 13)
dArr(R, 4) = sArr(I, 4)
End If
End If
Next
End If
Next
If K > R Then Z = K Else Z = R
Sheet1.Range("E8").Resize(Z, 4).Value = dArr
End Sub