Sub ListFiles()
Application.ScreenUpdating = False
Dim path As String
path = "C:\FullPath\ToFolder\" 'must end with path separator ( \ )
Cells.Clear
Cells(1, 1).Resize(, 3).Value = Array("File", "Type", "File Path")
Call GetFiles(path)
With Cells(1, 1)
.Activate
.AutoFilter
End With
End Sub
Private Sub GetFiles(ByVal path As String)
Application.ScreenUpdating = False
Dim FSO As Object, Fldr As Object, subF As Object, file As Object, extn As String
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Fldr = FSO.GetFolder(path)
For Each subF In Fldr.SubFolders
GetFiles (subF.path)
Next subF
For Each file In Fldr.Files
On Error Resume Next
extn = Right(file.Name, Len(file.Name) - InStrRev(file.Name, "."))
If Err.Number = 0 Then Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Resize(, 3) = Array(file.Name, extn, Replace(file.path, file.Name, ""))
On Error GoTo 0
Next file
Set FSO = Nothing
Set Fldr = Nothing
Set subF = Nothing
Set file = Nothing
End Sub