With Sheet15
SoduNo = .[H13]: SoduCo = .[I13]
For i = 3 To UBound(arr)
If arr(i, 4) >= .Range("G1") And arr(i, 4) <= .Range("I1") _
And arr(i, 12) = .Range("K2") And arr(i, 7) = .Range("K3") Then
k = k + 1
kq(k, 1) = arr(i, 2)
kq(k, 2) = arr(i, 3)
kq(k, 3) = arr(i, 4)
kq(k, 4) = arr(i, 11)
kq(k, 5) = arr(i, 13)
kq(k, 6) = arr(i, 14)
kq(k, 7) = 0
LuykeNo = LuykeNo + kq(k, 6)
LuykeCo = LuykeCo + kq(k, 7)
kq(k, 8) = Application.Max(SoduNo - SoduCo + LuykeNo - LuykeCo, 0)
kq(k, 9) = Application.Max(SoduCo - SoduNo + LuykeCo - LuykeNo, 0)
ElseIf arr(i, 4) >= .Range("G1") And arr(i, 4) <= .Range("I1") _
And arr(i, 13) = .Range("K2") And arr(i, 9) = .Range("K3") Then
k = k + 1
kq(k, 1) = arr(i, 2)
kq(k, 2) = arr(i, 3)
kq(k, 3) = arr(i, 4)
kq(k, 4) = arr(i, 11)
kq(k, 5) = arr(i, 12)
kq(k, 6) = 0
kq(k, 7) = arr(i, 14)
LuykeNo = LuykeNo + kq(k, 6)
LuykeCo = LuykeCo + kq(k, 7)
kq(k, 8) = Application.Max(SoduNo - SoduCo + LuykeNo - LuykeCo, 0)
kq(k, 9) = Application.Max(SoduCo - SoduNo + LuykeCo - LuykeNo, 0)
End If
Next i