'Recherche existence document dans onglet “Liste fichier”
Set WS = Worksheets("ListeFichiers") 'Adressage OngletSource
Set BD = WS.Range("a9:H" & WS.Range("a" & Rows.Count).End(xlUp).Row)
a = BD
Trouve = False
i = 2
Do While feuillecible.Cells(i, "B") <> ""
RefDoc = feuillecible.Cells(i, "B")
Extension = feuillecible.Cells(i, "E")
For j = 1 To UBound(a, 1)
If a(j, 1) = RefDoc And UCase(a(j, 5)) = UCase(Extension) Then
Trouve = True
Exit For
End If
Next j
If Trouve Then
Cells(i, "C") = a(j, 2)
Cells(i, "D") = a(j, 4)
Cells(i, "F") = a(j, 6) & a(j, 7)
Cells(i, "B").Hyperlinks.Add Anchor:=Cells(i, "B"), Address:=Cells(i, "F"), TextToDisplay:=Cells(i, "B").Value
Else
feuillecible.Cells(i, "B").Interior.ColorIndex = 36
End If
Trouve = False
i = i + 1
Loop