ChrisUK
Well-known Member
- Joined
- Sep 3, 2002
- Messages
- 675
Hi,
Can someone help me fix this code please, I could sit here trying and maybe fix it by the time I go home .... or I can ask someone for help
I'm trying to list all the files under a single folder, for example all the files in MyDocuments and in each folder under MyDocuments
I want to return for each file name the date it was last modified as well as the name.
Sub getfiles()
Set fs = Application.FileSearch
With fs
.LookIn = "C:\My Documents"
.Filename = "*.*"
If .Execute > 0 Then
Rows(x, 1) = fs.FoundFiles.Name
Rows(x, 2) = fs.FoundFiles.DateLastModified
End If
End With
End Sub
This is what I have so far which I'll admit I've taken from the help and tweaked it a little .... just not enough so it seems
Thanks in anticipation
Chris
Can someone help me fix this code please, I could sit here trying and maybe fix it by the time I go home .... or I can ask someone for help
I'm trying to list all the files under a single folder, for example all the files in MyDocuments and in each folder under MyDocuments
I want to return for each file name the date it was last modified as well as the name.
Sub getfiles()
Set fs = Application.FileSearch
With fs
.LookIn = "C:\My Documents"
.Filename = "*.*"
If .Execute > 0 Then
Rows(x, 1) = fs.FoundFiles.Name
Rows(x, 2) = fs.FoundFiles.DateLastModified
End If
End With
End Sub
This is what I have so far which I'll admit I've taken from the help and tweaked it a little .... just not enough so it seems
Thanks in anticipation
Chris