Mille merci [file name=Classeur1_20060511220608.zip size=7690]http://www.excel-downloads.com/components/com_simpleboard/uploaded/files/Classeur1_20060511220608.zip[/file]
Private Sub CommandButton1_Click()
If Range('A2').Value - Val(TextBox1.Value) inf 0 Then
MsgBox 'attention'
Exit Sub
Else
Range('b2').Value = TextBox1.Value
End If
End Sub
Il te suffit de modifier ton code de la manière suivante :
Code:
Private Sub CommandButton1_Click()
If Val(TextBox1.Value) < Cells(2, 1).Value Then
MsgBox 'veuillez saisir une valeur supérieure au stock'
Exit Sub
End If
Range('b2').Value = TextBox1.Value
End Sub