Out of interest..
Here's one that will do everything except your last bit (counting files in subfolders)...
It would be interesting to see if the last requirement could be added to it..
Private Sub CommandButton1_Click()
Dim Z
Z = Split(Replace(CreateObject("wscript.shell").exec("cmd /c forfiles /P C:\Test /S /M *.* /c ""cmd /c echo @file!@FSIZE!@fdate""").stdout.readall, Chr(34), ""), vbCrLf)
Range("A1").Resize(UBound(Z)).Value = Application.Transpose(Split(Join(Z, vbLf), vbLf))
Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row).TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, Other:=True, OtherChar:="!"
Range("A1").Resize(1, 3).Value = Array("FileName", "Size", "Date Modified")
End Sub
Bookmarks