Sub PlanifPrevue()
Dim ProdDuJour As Integer
Dim Capacite As Integer
Dim QteRestante As Integer
Dim AFaire As Integer
Dim PourCharge As Long
Dim Cellule As String
ProdDuJour = ActiveCell.Value
Cellule = Cells(ActiveCell.Row, 4).Value
PourCharge = Worksheets("CelluleV3").Columns(2).Find(what:=Cellule, LookAt:=xlWhole).Offset(0, 9).Value
MsgBox PourCharge
Capacite = Cells(ActiveCell.Row, 5).Value * PourCharge
QteRestante = Cells(ActiveCell.Row, 3).Value
If ProdDuJour < Capacite + 1 Then
If (Capacite - ProdDuJour) < QteRestante Then
AFaire = (Capacite - ProdDuJour)
Else: AFaire = QteRestante
End If
End If
' MsgBox "Jour: " & Weekday(Cells(7, ActiveCell.Column).Value)
Worksheets("Planifiée").Cells(ActiveCell.Row, ActiveCell.Column).Value = AFaire
End Sub