Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Public Sub IndexFiles()
- Dim cnt As Integer
- Dim i As Integer
- Dim rng As String
- Sheets.Add
- ActiveSheet.Name = "Index"
- With Application.FileSearch
- ' If you leave the lookin line out it will display this
- ' list for the current active directory.
- .LookIn = "R:\Dgpb\Groupe_travail_financement_activite\Site_securise_FTP\Recueil"
- .FileType = msoFileTypeAllFiles
- .SearchSubFolders = True
- .Execute
- End With
- cnt = Application.FileSearch.FoundFiles.Count
- For i = 1 To cnt
- rng = "A" & i
- Range(rng).Value = Application.FileSearch.FoundFiles.Item(i)
- Next
- End Sub
Add Comment
Please, Sign In to add comment