Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim MustLeaveForNext As Boolean 'déclaration générale ' ' Private Sub Form_Load() MustLeaveForNext = False 'facultatif Me.KeyPreview = True End Sub ' ' Private Sub Command1_Click() Dim i As Long For i = 0 To 70000 If MustLeaveForNext Then Exit For Label1.Caption = i DoEvents Next i MsgBox "Boucle quittée" End Sub ' ' Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) MustLeaveForNext = True End Sub Private Sub Form_KeyPress(KeyAscii As Integer) MustLeaveForNext = True End Sub