Sub test_restant_prod()
Dim i As Integer, dlg As Integer
Dim ws1 As Worksheet, ws2 As Worksheet
Application.ScreenUpdating = False
Set ws1 = Sheets("Cockpit")
Set ws2 = Sheets("Test")
Worksheets("test").Range("A5:B5000, D5:H5000").ClearContents
With ws1
'Quantité produite 1
For i = 6 To .Range("A" & Rows.Count).End(xlUp).Row
If .Cells(i, 10) = "" And .Cells(i, 9) < 0 Then
dlg = ws2.Range("A" & Rows.Count).End(xlUp).Row + 1
'Ligne
ws2.Range("A" & dlg) = .Range("A" & i)
'Code
ws2.Range("B" & dlg) = .Range("B" & i)
'Date Prod
ws2.Range("G" & dlg) = .Range("D" & i)
'Quantité produite
ws2.Range("E" & dlg) = .Range("I" & i)
'Entrée Prod
ws2.Range("H" & dlg) = "Entrée Prod"
End If
Next i
End With
End Sub