Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cel As Range
If Not Intersect(Target, Columns(22)) Is Nothing Then
Set Cel = Feuil4.UsedRange.Find(Target.Value, , xlValues, xlWhole)
If Cel Is Nothing Then
MsgBox "La commande n'existe pas", vbCritical, "ATTENTION !!!"
ActiveCell.Value = ""
ActiveCell.Interior.Color = RGB(255, 0, 0)
Else
If Not Cel Is Nothing And Cel.Offset(0, 10) > 0 Then
MsgBox "Provisions restante sur Commande :" & Chr(10) & Format(Cel.Offset(0, 10), "#,##0.00 €"), vbInformation, "NOTE"
Else
If Not Cel Is Nothing And Cel.Offset(0, 10) < 0 Then
MsgBox "Plus assez de provisions sur la commande :" & Chr(10) & Format(Cel.Offset(0, 10), "#,##0.00 €"), vbCritical, "ATTENTION !!!"
End If
End If
End If
End If
End Sub