Bonjour,
Voici ma macro qui est en fait une boucle infinie et je ne comprends pas pourquoi :
Sub AjoutLigne()
nb = 20
cpr = 0
i = InputBox(Prompt:="Nombre de produits à entrer dans le formulaire")
If i <> "" Then
If IsNumeric(i) Then
If cpr < i Then
While cpr <> i
MsgBox ("I vaut : " & i)
MsgBox ("cpr vaut : " & cpr)
Range("E" & nb & ":H" & nb).Select
Selection.Copy
Range("E" & (nb + 1) & ":H" & (nb + 1)).Select
Selection.PasteSpecial Paste:=xlFormats
cpr = cpr + 1
nb = nb + 1
Wend
End If
Else
MsgBox ("Veuillez entrez un nombre s'il vous plaît.")
End If
End If
End Sub