Sub Filedir()
Range("A7:A100").ClearContents
Cells(7, 1).Value = "File Name"
Cells(7, 2).Value = "DateCreated"
Cells(7, 3).Value = "DateLastModified"
Cells(7, 4).Value = "DateLastAccessed"
Cells(7, 5).Value = "File size"
fpath = "E:\test\" '<<<<<<<<<< to be changed
Call ShowFolderList(fpath, 8, 1)
End Sub
Sub ShowFolderList(fpath, arow, col)
Dim fs, f, f1, s, sf
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(fpath)
Set sf = f.SubFolders
Set NFile = f.Files
For Each pf1 In NFile
If pf1.Name = "" Then Exit Sub
' attr = pf1.Attributes
Cells(arow, col) = pf1.Name
Cells(arow, col + 1) = pf1.DateCreated
Cells(arow, col + 2) = pf1.DateLastModified
Cells(arow, col + 3) = pf1.DateLastAccessed
Cells(arow, col + 4) = pf1.Size
arow = arow + 1
Next
End Sub