Bonjour,
Normal, tu l'affiche à chaque fois, donc elle ne se termine jamais.
Et pour information, If n'est pas une boucle.
Public Drapeau As Boolean
Sub Test()
Drapeau = True
UserForm1.Show
Do While Drapeau = True
DoEvents
Loop
'If UserForm1.Drapeau Then
'msg box("ok1")
'Else
'MsgBox ("cancel1")
'End If
End Sub
'pour les boutons :
Private Sub CommandButton1_Click()
Drapeau = False
MsgBox "ok"
Hide
End Sub
Private Sub CommandButton2_Click()
Drapeau = False
MsgBox "cancel"
Hide
End Sub
ça devrait mieux fonctionner.