Private Sub CommandButton1_Click()
mot = InputBox("Mot à rechercher ? ENTREZ : N°Qmos/ N°norme matiére / Groupe matiére")
If mot = "" Then Exit Sub
For feuille = 1 To Sheets.Count
Sheets(feuille).Select
Set trouvé1 = Cells.Find(What:=mot)
If Not trouvé1 Is Nothing Then
With trouvé1
.Activate
.Select
.EntireRow.Interior.ColorIndex = 6 'remplit de jaune la ligne entière de l'occurrence trouvée
End With
étiq:
If MsgBox("Suivant ?", 4) = vbNo Then Exit Sub
Set trouvé2 = Cells.FindNext(After:=ActiveCell)
Set trouvé3 = Cells.FindPrevious(After:=ActiveCell)
Do While trouvé2 <> trouvé1
With trouvé1
.Select
.Font.ColorIndex = 0
End With
With trouvé3
.Select
.Font.ColorIndex = 0
End With
With trouvé2
.Activate
.Select
EntireRow.Interior.ColorIndex = 6 'remplit de jaune la ligne entière de l'occurrence trouvée
End With
GoTo étiq
Loop
End If
Next feuille
MsgBox "PLUS DE RESUSLTAT"
End Sub
Private Sub CommandButton2_Click() 'bouton annuler couleur
Dim x As Byte 'déclare la variable x (incrément d'onglet)
For x = 1 To Sheets.Count 'boucle sur touts les onglets du classeur
With Sheets(x) 'prend en compte l'onglet x
.Cells.Interior.ColorIndex = xlNone 'enlève la couleur à toutes les cellules de l'onglet
End With 'fin de la prise en compte l'onglet x
Next x 'prochain onglet du classeur
End Sub