Re,
Voici un essai, avec les 100 dossiers faute d'infos précises concernant les 6 dossiers à cibler :
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
cancel = true
Dim rep$, motcle$
rep = "C:\Users\rinal\Documents\re\" 'repertoire parent
motcle = target.value 'mot à chercher
ChercherOuvrirFichier rep, motcle
End Sub
function ChercherOuvrirFichier(Rep$, Motcle$)
dim n&, t(), i&, fichier$, dossier$
if motcle = "" then exit sub
if dir(left(rep, len(rep) - 1), vbdirectory) = "" then
msgbox "chemin inexistant", 16: exit function
end if
dossier = dir(rep, vbdirectory)
while dossier <> ""
if not dossier like "*.*" then
n = n + 1: redim preserve t(1 to n)
t(n) = rep & dossier & "\"
end if
dossier = dir
wend
if n = 0 then msgbox "aucun dossier trouvé", 16: exit function
for i = lbound(t) to ubound(t)
fichier = dir(t(i) & "*" & motcle & "*.pdf")
if fichier <> "" then
Shell "C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Acrobat.exe " & t(i) & fichier
exit function
end if
next i
fin:
MsgBox "Impossible de trouver un fichier contenant :" & motcle
end function
Cdlt,