Option Explicit
Private TRés(), LCou As Long, FSO As New FileSystemObject
Sub ListeFic()
ReDim TRés(1 To 10000, 1 To 2)
LCou = 0
Lister FSO.GetFolder(ActiveSheet.Cells(2, "D").Value)
ActiveSheet.Rows(3).Resize(10000).Delete
ActiveSheet.[A3].Resize(LCou, 2).Value = TRés
Erase TRés
End Sub
Private Sub Lister(ByVal Fdr As Scripting.Folder)
Dim ChemDoss As String, FdrS As Scripting.Folder, Fle As Scripting.File
ChemDoss = Fdr.Path
On Error Resume Next
For Each Fle In Fdr.Files
If Fle Is Nothing Then Exit For
LCou = LCou + 1
TRés(LCou, 1) = ChemDoss
TRés(LCou, 2) = Fle.Name
Next Fle
For Each FdrS In Fdr.SubFolders
If FdrS Is Nothing Then Exit Sub
Lister FdrS: Next FdrS
End Sub