Excel VBA: Comparer de text en section
Résolu/Fermé
A voir également:
- Excel VBA: Comparer de text en section
- Excel VBA: Comparer de text en section ✓ - Forum - Excel
- Excel vba comparer textbox et cellule ✓ - Forum - Excel
- Excel vba zone de texte et retour a la ligne ✓ - Forum - VB / VBA
- Excel vba write to text file ✓ - Forum - VB / VBA
- Excel vba convertir texte en nombre ✓ - Forum - VB / VBA
2 réponses
gbinforme
4 août 2011 à 09:52
- Messages postés
- 14935
- Date d'inscription
- lundi 18 octobre 2004
- Statut
- Contributeur
- Dernière intervention
- 24 juin 2020
4 août 2011 à 09:52
bonjour
Tu peux aussi utiliser find qui est prévu pour cela.
Un petit exemple de macro à lancer avec le texte cherché en paramètre :
Tu peux aussi utiliser find qui est prévu pour cela.
Un petit exemple de macro à lancer avec le texte cherché en paramètre :
Public Sub chercher(texte_à_chercher) Dim lig As Long, deb As Range, sel As Range Set deb = Range("A1") Do Set sel = Columns(1).Cells.Find(what:=texte_à_chercher, After:=deb, LookIn:=xlValues, LookAt:=xlPart) If sel Is Nothing Then Exit Sub If sel.Row <= deb.Row Then Exit Sub sel.Offset(0, 1).Value = "OUI" Set deb = sel Loop End Sub