Option Explicit
Sub Test()
BoucleFichiers ActiveSheet.[A10:A12]
BoucleFichiers ActiveSheet.[C10:C12]
BoucleFichiers ActiveSheet.[E10:E12]
End Sub
Sub BoucleFichiers(ByVal RDoss As Range)
Dim TDoss(), TRésu(), L As Long, TJn() As String, NomFic As String, N As Long
If RDoss.Rows.Count = 1 Then
ReDim TDoss(1 To 1, 1 To 1): TDoss(1, 1) = RDoss.Value
Else
TDoss = RDoss.Value: End If
ReDim TRésu(1 To UBound(TDoss, 1), 1 To 1)
For L = 1 To UBound(TDoss, 1)
ReDim TJn(0 To 49): N = -1
NomFic = Dir(TDoss(L, 1) & "*.*")
Do While NomFic <> ""
N = N + 1: TJn(N) = NomFic
NomFic = Dir
Loop
If N >= 0 Then
ReDim Preserve TJn(0 To N)
TRésu(L, 1) = Join(TJn, vbLf)
End If
Next L
RDoss.Offset(, 1).Value = TRésu
End Sub