Here's some code I had on hand - see if it suits your purpose (it may need some tweaking):
Sub Runnit() 'Run the Directory
Dim S As String, P As String, U As String, i As Integer: i = 1
P = ActiveWorkbook.Path 'or the directory to run
P = P & "\": U = Dir(P): S = P & U: i = i + 1
ThisWorkbook.Sheets("Sheet1").Activate 'or wherever you want the list
NextBook:
If InStr(1, S, ".xls") Then
Cells(i, 1) = U: Cells(i, 2) = FileLen(P & U)
Else:
i = i - 1: GoTo GetNextBook: End If
GetNextBook: i = i + 1
'If i > 50 Then Exit Sub 'Failsafe
On Error GoTo EndSub
U = Dir()
GoTo NextBook
EndSub: End Sub
Bookmarks