can you help me?
i want a macro vba that search for a SPECIFIC subfolder for example (Xfolder) between all the folders and subfolders that exist and move their files.
P:\Desktop\Folder1\subfolder\SUBFOLDER1\Xfolder
I'm using the VBA Scripting Runtime objects
Set oSourceFolder = fso.GetFolder(source)
If Dir(destinationFolder, 16) = "" Then MkDir (destinationFolder)
For Each oFile In oFolder.Files
If Dir(destinationFolder,16) = "" Then
fso.MoveFile oFile.Path, destinationFolder
End If
Next oFile
fso.DeleteFolder oFolder.Path
Next oFolder
Here's a solution:
strStartFolder is the folder to Screen for subfolders. strMoveFolder is the name of the Folder to look for. strTargetFolder is the Folder to where all the strMoveFolder's files shall be moved.
To found some folder use something like this
And then you can do whatever with that folder and its content. So with i little use of google (one maybe two words) you can achieve what you wana