Re : Problème msgbox
Bonsoir,
Voici le code : (Les conditions seront a adapter en fonction de vos besoins
Sub stock_apres_conso()
Range("B7") = stock_apres_consommation(Range("B5"), Range("B3"))
If Range("B7") < Range("B9") Then
MsgBox ("Stock minimum atteint, veuillez passer une commande")
End If
End Sub
Function stock_apres_consommation(stock_initial As Single, quantite_consommee As Single)
stock_apres_consommation = stock_initial - quantite_consommee
End Function
Sub stock_apres_consoB()
Range("C7") = stock_apres_consommationB(Range("C5"), Range("C3"))
If Range("B7") < Range("B9") Then
MsgBox ("Stock minimum atteint, veuillez passer une commande")
End If
End Sub
Function stock_apres_consommationB(stock_initialB As Single, quantite_consommeeB As Single)
stock_apres_consommationB = stock_initialB - quantite_consommeeB
End Function
Function observ_stock_apres_consommation(stock_apres_consommation As Long)
If Range("B7").Value < Range("B9").Value Then
MsgBox ("stock mini atteint, veuillez passer une commande" = vbOKOnly)
Exit Function
End If
End Function
Function observ_stock_apres_consommationB(stock_apres_consommationB As Long)
If Range("C7").Value < Range("C9").Value Then
MsgBox ("stock mini atteint, veuillez passer une commande" = vbOKOnly)
Exit Function
End If
End Function
Sub stock_apres_consoC()
Range("D7") = stock_apres_consommationC(Range("D5"), Range("D3"))
If Range("B7") < Range("B9") Then
MsgBox ("Stock minimum atteint, veuillez passer une commande")
End If
End Sub
Function stock_apres_consommationC(stock_initialC As Single, quantite_consommeeC As Single)
stock_apres_consommationC = stock_initialC - quantite_consommeeC
End Function
Function observ_stock_apres_consommationC(stock_apres_consommationC As Long)
If Range("D7").Value < Range("D9").Value Then
MsgBox ("stock mini atteint, veuillez passer une commande" = vbOKOnly)
Exit Function
End If
End Function
Sub stock_apres_consoD()
Range("E7") = stock_apres_consommationD(Range("E5"), Range("E3"))
If Range("B7") < Range("B9") Then
MsgBox ("Stock minimum atteint, veuillez passer une commande")
End If
End Sub
Function stock_apres_consommationD(stock_initialD As Single, quantite_consommeeD As Single)
stock_apres_consommationD = stock_initialD - quantite_consommeeD
End Function
Function observ_stock_apres_consommationD(stock_apres_consommationD As Long)
If Range("E7").Value < Range("E9").Value Then
MsgBox ("stock mini atteint, veuillez passer une commande" = vbOKOnly)
Exit Function
End If
End Function
Sub stock_apres_consoE()
Range("F7") = stock_apres_consommationE(Range("F5"), Range("F3"))
If Range("B7") < Range("B9") Then
MsgBox ("Stock minimum atteint, veuillez passer une commande")
End If
End Sub
Function stock_apres_consommationE(stock_initialE As Single, quantite_consommeeE As Single)
stock_apres_consommationE = stock_initialE - quantite_consommeeE
End Function
Function observ_stock_apres_consommationE(stock_apres_consommationE As Long)
If Range("F7").Value < Range("F9").Value Then
MsgBox ("stock mini atteint, veuillez passer une commande" = vbOKOnly)
Exit Function
End If
End Function
Sub stock_apres_consoF()
Range("G7") = stock_apres_consommationF(Range("G5"), Range("G3"))
If Range("B7") < Range("B9") Then
MsgBox ("Stock minimum atteint, veuillez passer une commande")
End If
End Sub
Function stock_apres_consommationF(stock_initialF As Single, quantite_consommeeF As Single)
stock_apres_consommationF = stock_initialF - quantite_consommeeF
End Function
Function observ_stock_apres_consommationF(stock_apres_consommationF As Long)
If Range("G7").Value < Range("G9").Value Then
MsgBox ("stock mini atteint, veuillez passer une commande" = vbOKOnly)
Exit Function
End If
End Function
Sub stock_apres_consoG()
Range("H7") = stock_apres_consommationG(Range("H5"), Range("H3"))
If Range("B7") < Range("B9") Then
MsgBox ("Stock minimum atteint, veuillez passer une commande")
End If
End Sub
Function stock_apres_consommationG(stock_initialG As Single, quantite_consommeeG As Single)
stock_apres_consommationG = stock_initialG - quantite_consommeeG
End Function
Function observ_stock_apres_consommationG(stock_apres_consommationG As Long)
If Range("H7").Value < Range("H9").Value Then
MsgBox ("stock mini atteint, veuillez passer une commande" = vbOKOnly)
Exit Function
End If
End Function
Sub stock_apres_consoH()
Range("I7") = stock_apres_consommationH(Range("I5"), Range("I3"))
If Range("B7") < Range("B9") Then
MsgBox ("Stock minimum atteint, veuillez passer une commande")
End If
End Sub
Function stock_apres_consommationH(stock_initialH As Single, quantite_consommeeH As Single)
stock_apres_consommationH = stock_initialH - quantite_consommeeH
End Function
Function observ_stock_apres_consommationH(stock_apres_consommationH As Long)
If Range("I7").Value < Range("I9").Value Then
MsgBox ("stock mini atteint, veuillez passer une commande" = vbOKOnly)
Exit Function
End If
End Function
Laurent