Bonjour,
Code à placer dans votre Userform ou dans le module de votre onglet :
Private Sub tbcarton_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr("1234567890", Chr(KeyAscii)) = 0 Then KeyAscii = 0
End Sub
Private Sub tbpaquet_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr("1234567890", Chr(KeyAscii)) = 0 Then KeyAscii = 0
End Sub
A la validation, testez les quantités :
If Val(tbcarton) = 0 And Val(tbpaquet) = 0 Then
MsgBox "Saisissez au moins une quantité !"
Exit Sub
End If