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
| Dim plage As Range
Dim Msg, Style, Title, Response
With Sheets("Feuil1")
Set plage = .Range("A1:A" & .Range("A" & Rows.Count).End(xlUp).Row)
For Each c In plage
'si le mot dans la cellule commence par BO alors
If c.Value Like "BO*" Then
Msg = "Voici le Pays trouvé: " & c.Value & Chr(10) & " Souhaitez-vous poursuivre votre recherche?" ' Définit le message.
Style = vbYesNo + vbInformation + vbDefaultButton2 ' Définit les boutons.
Title = "Résultat de Recherche" ' Définit le titre.
' Affiche le message.
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then ' L'utilisateur a choisi Oui.
GoTo prochain
Else ' L'utilisateur a choisi Non.
Exit For ' Effectue une action.
End If
End If
prochain:
Next c
End With |
Partager