Sub GetFilesInFolder(SourceFolderName As String)
'--- For Example:Folder Name= "D:\Folder Name\" </SPAN>
Dim FSO As Scripting.FileSystemObject </SPAN>
Dim SourceFolder As Scripting.folder, SubFolder As Scripting.folder </SPAN>
Dim FileItem As Scripting.File </SPAN>
Set FSO = New Scripting.FileSystemObject </SPAN>
Set SourceFolder = FSO.GetFolder(SourceFolderName) </SPAN>
'--- This is for displaying, whereever you want can be configured </SPAN>
r = 14
For Each FileItem In SourceFolder.Files </SPAN>
Cells(r, 2).Formula = r - 13
Cells(r, 3).Formula = FileItem.Name
Cells(r, 4).Formula = FileItem.Path
Cells(r, 5).Formula = FileItem.Size
Cells(r, 6).Formula = FileItem.Type
Cells(r, 7).Formula = FileItem.DateLastModified
Cells(r, 8).Formula = "=HYPERLINK(""" & FileItem.Path & """,""" & "Click Here to Open" & """)" </SPAN>
r = r + 1 ' next row number </SPAN>
Next FileItem </SPAN>
Set FileItem = Nothing </SPAN>
Set SourceFolder = Nothing </SPAN>
Set FSO = Nothing
End Sub