Sub recherche(mot)
On Error GoTo fin
Set ws = Worksheets("Fiche de Présentations")
With ws.Range("D7:E16") 'Modifier la plage de recherche au besoin
trouve = False '***
Set c = .Find(mot, LookIn:=xlValues, lookat:=xlPart)
If Not c Is Nothing Then
trouve = True '***
firstAddress = c.Address
Do
With Sheets("Moteur de recherche")
.Hyperlinks.Add Anchor:=.[A65000].End(xlUp).Offset(1, 0), Address:="", SubAddress:="'" & ws.Name _
& "'!" & c.Address, TextToDisplay:="" & c.Value
End With
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
'trouve = True
End If
End With
'Cette partie ne peut pas fonctionner car la feuille "Rapports 2013" n'est pas dans ton fichier
' on la saute pour l'instant.
GoTo Suite
Set ws = Worksheets("Rapports 2013")
With ws.Range("D7:D16") 'Cette plage aussi doit être modifiée
Set c = .Find(mot, LookIn:=xlValues, lookat:=xlPart)
If Not c Is Nothing Then
trouve = True '***
firstAddress = c.Address
Do
With Sheets("Moteur de recherche")
.Hyperlinks.Add Anchor:=.[A65000].End(xlUp).Offset(1, 0), Address:="", SubAddress:="'" & ws.Name _
& "'!" & c.Address, TextToDisplay:="" & c.Value
End With
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
trouve = True
End If
End With
Suite:
If Not trouve Then MsgBox ("Pas de " & mot & " trouvé dans ce fichier")
fin:
End Sub