Private Sub Worksheet_Change(ByVal Target As Range)
Dim lig, col, n
If Target.Count > 1 Then Exit Sub
If Not Intersect(Range(Target.Address), Range("C24:C36")) Is Nothing Then
lig = Target.Row
If Cells(lig, 2) = "" Then Exit Sub
With Feuil3
col = Application.Match(Cells(lig, 1), .[A1:ZZ1], 0)
n = Application.VLookup(Cells(lig, 2), .Range(.Cells(2, col), .Cells(500, col + 7)), 7, False)
px = Application.VLookup(Cells(lig, 2), .Range(.Cells(2, col), .Cells(500, col + 7)), 3, False)
Application.EnableEvents = False
Cells(lig, 4) = px: Cells(lig, 5) = px * Target.Value
Application.EnableEvents = True
If Target.Value > n Then
Target.Select
MsgBox "Le stock est seulement de : " & n, vbExclamation, "STOCK INSUFFISANT"
End If
End With
End If
End Sub