Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. Sub copy_files_from_subfolders()
  2. Dim fso As Object
  3. Dim fld As Object
  4. Dim fsofile As Object
  5. Dim fsofol As Object
  6.  
  7. sourcepath = "FINAL CUT"
  8. destinationpath = "DesaMECA"
  9.  
  10. If Right(sourcepath, 1) <> "" Then
  11. sourcepath = sourcepath & ""
  12. End If
  13.  
  14. Set fso = CreateObject("scripting.filesystemobject")
  15. Set fld = fso.GetFolder(sourcepath)
  16. If fso.FolderExists(fld) Then
  17. For Each fsofol In fso.GetFolder(sourcepath).SubFolders
  18. For Each fsofile In fsofol.Files
  19. If Right(fsofile, 6) = 566978 Then
  20. fsofile.Copy destinationpath
  21. End If
  22. Next
  23. Next
  24. End If
  25. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement