import filenames

D

driller

I have a hell of work updating the list of filenames located in one folder.
The folder contains different file name ext.
The files stored in this folder increased every week.

Can I do importing the filenames and filedates to excel ?How?

thanks in advance
 
J

Joel

Use this macro

Sub getdates()
Folder = "C:\temp"
Set fso = CreateObject _
("Scripting.FileSystemObject")

Set Folder = _
fso.GetFolder(Folder)

RowNumber = 1
'folder size in bytes
On Error GoTo 200
For Each fl In Folder.Files
Sheets(1).Cells(RowNumber, "C") = fl.DateLastModified
Sheets(1).Cells(RowNumber, "B") = fl.Size
Sheets(1).Cells(RowNumber, "A") = strFolder & fl.Name
RowNumber = RowNumber + 1
Next fl

200 On Error GoTo 0


End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top