View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
FrodeOlsen FrodeOlsen is offline
external usenet poster
 
Posts: 7
Default List FullFilePath and File name

Folks,

There seems to be a number of people that have varuis scripts to list
filename with full path here. Hovever, it seems that this one is one
of tha fastest i have tried so far. The only problem is that i need
this to also include all "SubFolders" not just one folder.

How can that be done ?




Sub ListFiles02()
'Using FileSearch to list the files in a directory
Dim i As Integer
i = 1
With Application.FileSearch
..NewSearch
..LookIn = "C:\GTA\Loaded Drawings\"
..Filename = "*.*"
.SearchSubFolders = True
'.SearchFolders = False
..Execute
For i = 1 To .FoundFiles.Count
Range("B" & i + 1).Value = .FoundFiles(i)
Range("C" & i + 1).Value = FileDateTime(.FoundFiles(i))
'Range("D" & i+1).Value = FileLen(.FoundFiles(i))
Next


End With


End Sub