XL 2010 macro de recherche

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

michel.dupont

XLDnaute Occasionnel
bonjour
qui peut m'aider ? ce code me retourne une erreur de compilation variable non définie...quelle correction apporter
merci et bonne journée
Michel

Sub cherche_plusieurs()
[A:C].Interior.ColorIndex = xlNone
nom = InputBox("Nom cherché?")
If nom = "" Then Exit Sub
Set c = [A:A].Find(nom, , , xlWhole)
If Not c Is Nothing Then
premier = c.Address
Do
c.Resize(, 3).Interior.ColorIndex = 4
Set c = [A:A].FindNext(c)
Loop While Not c Is Nothing And c.Address <> premier
End If
End Sub
 
Re

Et comme ceci?
VB:
Sub cherche_plusieurs()
Dim c As Range, nom
[A:C].Interior.ColorIndex = xlNone
nom = InputBox("Nom cherché?")
If nom = "" Then Exit Sub
Set c = [A:A].Find(nom, , , xlWhole)
If Not c Is Nothing Then
premier = c.Address
Do
c.Resize(, 3).Interior.ColorIndex = 4
Set c = [A:A].FindNext(c)
Loop While Not c Is Nothing And c.Address <> premier
End If
End Sub
 
Re

Et comme cela?
VB:
Sub cherche_plusieurs()
Dim c As Range, premier$, nom
[A:C].Interior.ColorIndex = xlNone
nom = InputBox("Nom cherché?")
If nom = "" Then Exit Sub
Set c = [A:A].Find(nom, , , xlWhole)
If Not c Is Nothing Then
premier = c.Address
Do
c.Resize(, 3).Interior.ColorIndex = 4
Set c = [A:A].FindNext(c)
Loop While Not c Is Nothing And c.Address <> premier
End If
End Sub
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
7
Affichages
282
Réponses
2
Affichages
170
Réponses
4
Affichages
239
Retour