Sub Compile()
Application.ScreenUpdating = False
DL = Range("A65500").End(xlUp).Row
If DL > 1 Then Range("A2:F" & DL).ClearContents
DueDate = [EndateDu]: Lecr = 2
For Each sh In Worksheets
With Sheets(sh.Name)
If .[A1] = "ORDER NO" Then
Order = .[B1]
DL = .Range("F65500").End(xlUp).Row
For L = 1 To DL
If .Cells(L, "A") = "PO" Then PO = .Cells(L + 1, "A")
If .Cells(L, "F") = DueDate Then
Cells(Lecr, "A") = Order
Cells(Lecr, "B") = PO
Cells(Lecr, "C") = .Cells(L, "A") ' Invoice
Cells(Lecr, "D") = .Cells(L, "B") ' Nbpieces
Cells(Lecr, "E") = .Cells(L, "C") ' Total
Cells(Lecr, "F") = .Cells(L, "D") ' Advance
Cells(Lecr, "G") = .Cells(L, "E") ' Balance
Lecr = Lecr + 1
End If
Next L
End If
End With
Next sh
End Sub