Dim boul As Boolean
Sub worksheet_change(ByVal target As Range) 'Demande automatiquement le nom du fournisseur si
'la valeur entrée dans la colonne A est "AUTRE"
Dim R&, PV, PA
If boul Then boul = False: Exit Sub
If Not Intersect(target, Range("F3:F100")) Is Nothing Then
If Range("A" & target.Row) = "AUTRE" Then
R = target.Row
fournisseur = InputBox("Saisie du Nom du fournisseur : ", "Fournisseur")
If StrPtr(fournisseur) = 0 Then MsgBox "annulation": With Application: .EnableEvents = False: .Undo: boul = True: .EnableEvents = True: End With: Exit Sub
Range("A" & R) = UCase$(fournisseur)
PA = InputBox("Prix d'achat : ", "Prix d'achat")
Range("H" & R).Value = PA
PV = InputBox("Prix de vente : ", "Prix de vente")
Range("I" & R).Value = PV
End If
End If
End Sub