Dim f As Object
Const c_sEXT As String = "xls"
Dim fso As Object: Set fso = CreateObject("Scripting.FileSystemObject")
With fso
With .GetFolder(ThisWorkbook.Path)
For Each f In .Files
If fso.GetExtensionName(f.Name) = c_sEXT Then
ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Value = f.Name
End If
Next f
End With
End With
|