Guest User

Untitled

a guest
Aug 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. Option Explicit
  2.  
  3. Public Sub IndexFiles()
  4. Dim cnt As Integer
  5. Dim i As Integer
  6. Dim rng As String
  7.  
  8. Sheets.Add
  9. ActiveSheet.Name = "Index"
  10.  
  11. With Application.FileSearch
  12. ' If you leave the lookin line out it will display this
  13. ' list for the current active directory.
  14. .LookIn = "R:\Dgpb\Groupe_travail_financement_activite\Site_securise_FTP\Recueil"
  15. .FileType = msoFileTypeAllFiles
  16. .SearchSubFolders = True
  17. .Execute
  18. End With
  19.  
  20.  
  21. cnt = Application.FileSearch.FoundFiles.Count
  22.  
  23. For i = 1 To cnt
  24. rng = "A" & i
  25. Range(rng).Value = Application.FileSearch.FoundFiles.Item(i)
  26. Next
  27. End Sub
Add Comment
Please, Sign In to add comment