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 27 28 29 30 31 32 33 34 35 36
| Sub RechercherNoms()
Dim Sh As Worksheet
Dim c As Range
Dim Nom As String, firstAddress As String
Nom = InputBox("Nom à chercher dans toutes les feuilles", "Rechercher")
If Nom <> "" Then
For Each Sh In ThisWorkbook.Worksheets
'Sh.Range("A3:E" & Sh.Range("A" & Rows.Count).End(xlUp).Row).Interior.ColorIndex = xlNone
Set c = Sh.Columns("A:E").Find(Nom, LookIn:=xlValues, LookAt:=xlPart)
If Not c Is Nothing Then
Sh.Activate
c.Select
firstAddress = c.Address
Do
If Sh.Name = "TOTO" Then
Range("A" & c.Row & ":C" & c.Row).Interior.ColorIndex = 38
Else
If Sh.Name = "LOGICIELS - LICENCES" Then
Range("A" & c.Row & ":D" & c.Row).Interior.ColorIndex = 38
Else
End If
Range("A" & c.Row & ":E" & c.Row).Interior.ColorIndex = 38
End If
strreponse = MsgBox(Sh.Name & "!" & c.Address & vbCrLf & _
"Oui pour continuer la recherche" & vbLf & _
"Non pour sortir", vbYesNo)
If strreponse = vbNo Then Exit Sub
Set c = Sh.Columns("A:E").FindNext(c)
c.Select
Loop While Not c Is Nothing And c.Address <> firstAddress
Set c = Nothing
End If
Next Sh
End If
End Sub |
Partager