bassojea
Messages postés11Date d'inscriptionmercredi 8 août 2007StatutMembreDernière intervention22 mars 2010
-
22 mars 2010 à 09:00
bassojea
Messages postés11Date d'inscriptionmercredi 8 août 2007StatutMembreDernière intervention22 mars 2010
-
22 mars 2010 à 12:54
Bonjour à tous
qui peut me donner la solution à mon prob....
voilà : a partir d'un inputbox dans lequel je tape un mot a chercher la macro va me chercher le mot dans la liste[a1:a500] et m'en grossit le caractère
le probleme c'est que lorsque par exemple je tape "titi" il me selectionne tout ce qui possede un "t" ou un "i"...alors que je voudrais grossir le caractère "titi"exclusivement.Merci de m'éclairer voilà mon code
Sub cherchemot()
Dim Cell As Variant
mot = InputBox("entrez valeur")
[a1:a500].Select
For Each Cell In Selection
If InStr(1, Cell, mot, vbTextCompare) > 0 Then
Selection.Characters.Font.Size = 14
End If
Next Cell
End Sub
cs_loulou69
Messages postés672Date d'inscriptionmercredi 22 janvier 2003StatutMembreDernière intervention 2 juin 20161 22 mars 2010 à 10:03
Bonjour
A tester !!!
Sub cherchemot()
Dim Cell As Variant
Dim indMot as long
mot = InputBox("entrez valeur")
[a1:a500].Select
For Each Cell In Selection
indMot= InStr(1, Cell, mot, vbTextCompare)
if indMot > 0 Then
Dim c ' pour un caractère
Dim i as Long
i=0
For each c in Selection.Range.Characters
If i>=indMot and i<=indMot+Len(mot) Then
c.Font.Size= 14
End If
i=i+1
Next
End If
Next Cell
End Sub
bassojea
Messages postés11Date d'inscriptionmercredi 8 août 2007StatutMembreDernière intervention22 mars 2010 22 mars 2010 à 10:55
bonjour loulou69 et merci de t occuper de moi
je fais fonctionner la macro pas à pas
elle tourne bien pour chaque cellule visitée
mais qunad elle rencontre le mot à trouver un message d'erreur apparait "nombre d'arguments incorrect ou affectation de propriété incorrecte" erreur450 mais on ne doit pas etre loin de la vérité
.....a plus