Bonjour tout le monde.
Petite question :
J'utilise une Msgbox de la maniere suivante (voir en gras)
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
| Private Sub CommandButton3_Click()
Dim Plage As Range
Set Plage = Range("C2:C65536").Find(TextBox15.Value)
If Plage Is Nothing Then
TextBox17.Value = "No Match"
Else
TextBox1.Value = Cells(Plage.Row, 1).Value
Do Until Plage Is Nothing
If MsgBox("Suivant", vbYesNo + vbInformation) = vbNo Then Exit Do
Set Plage = Range("C2:C65536").FindNext(Plage)
TextBox1.Value = Cells(Plage.Row, 1).Value
Plage.Select
Loop
End If
End Sub |
Je souhaite supprimer cette ligne
If MsgBox("Suivant", vbYesNo + vbInformation) = vbNo Then Exit Do
pour ne plus utiliser de MsgBox mais un CommandButton.
Un truc du genre
if CommandButton = Not Click Then Exit Do
et si c"est CommandButton = Click alors ca donne le meme resultat que la msgbox.
Merci pour votre aide
Partager