Bonjour,
j'ai fait deux boucle Do ... Loop
il se trouve que je n'arrive pas à en sortir.
il doit y avoir un critère manquant...
Merci d'avance de votre aide!!
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 Dim Nbpoints as Variant Dim rep as Boolean Do Do Nbpoints = InputBox("Combien de points voulez-vous créer? ", "TRAPRO DESIGN", "Entrer le nombre de points ici") If StrPtr(Nbpoints) = 0 Then rep = MsgBox("Souhaitez-vous quitter l'application?", vbExclamation + vbMsgBoxSetForeground + vbYesNo, "TRAPRO DESIGN") If rep = True Then 'MsgBox "Procédure annulée" ActiveWorkbook.Close Exit Sub End If End If Loop While Nbpoints = "" If Not IsNumeric(Nbpoints) Then MsgBox "La saissie : " & Nbpoints & " est invalide!", vbExclamation, "TRAPRO DESIGN" End If If IsNumeric(Nbpoints) And Nbpoints <= 0 Then MsgBox "La saissie : " & Nbpoints & " est invalide! Il ne peut y avoir un nombre nul ou négatif de points.", vbExclamation, "TRAPRO DESIGN" End If If IsNumeric(Nbpoints) And Nbpoints > 50 Then MsgBox "La saissie : " & Nbpoints & " est invalide! Le maximum est de 50 points.", vbExclamation, "TRAPRO DESIGN" End If Loop While IsNumeric(Nbpoints) And 0 < Nbpoints <= 50
JB
Partager