Option Base 0
Sub BigFiles()
Dim f() As Variant, e As Variant, bigf() As Variant, i As Long
f() = FindFiles(ThisWorkbook.Path, "*.xls")
i = -1
For Each e In f()
'Get files larger than 25 kb
If FileLen(e) / 1000 > 25 Then
i = i + 1
ReDim Preserve bigf(i)
bigf(i) = e
End If
Next e
If bigf(0) = "" Then Exit Sub
Range("A:A").ClearContents
Range("A1").Resize(UBound(bigf) + 1) = bigf()
End Sub
Function FindFiles(sRootFolder As String, sFiles As String, _
Optional searchSubFolders As Boolean = True) As Variant
Dim fs As Object
Dim strFilename As String
Dim i As Long, LastRow As Long
Dim a() As Variant
Set fs = Application.FileSearch
With fs
.LookIn = sRootFolder
.Filename = sFiles 'set your filename or extension with wilcards if needed.
.searchSubFolders = searchSubFolders
LastRow = .FoundFiles.Count
If .Execute() > 0 Then
For i = 1 To LastRow
strFilename = .FoundFiles(i)
ReDim Preserve a(i - 1)
a(i - 1) = strFilename
Next i
Else
MsgBox "No files found", vbCritical
End If
End With
FindFiles = a()
End Function