Sub test()
Dim chemin$, Fichier$, Rng As Range, Feuille$
chemin$ = "C:\Users\polux\DeskTop\"
Fichier$ = "Exemple.xlsx"
Set Rng = [D1:D100000]
Feuille = "Feuil1"
MsgBox GetLastRowColInClosedFich(chemin, Fichier, Feuille, Rng)
End Sub
Function GetLastRowColInClosedFich(chemin$, Fichier$, Feuille, Rng As Range)
'collection fichiers fermé derniere ligne dans une colonne de fichiers fermé:patricktoulon
Dim Addr$, Formule, n&
Addr = Rng.Address(, , xlR1C1)
Formule = "'" & chemin & "[" & Fichier & "]" & Feuille & "'!" & Addr
On Error Resume Next
n = ExecuteExcel4Macro("MATCH(""zzz""," & Formule & ")") 'dernière cellule texte en colonne D
On Error GoTo 0
GetLastRowColInClosedFich = n
End Function