Yes simple, use the File System Object and a recursive loop. Below is code that I found googling the search terms (VBA FSO recursive folder). I'll leave it up to you to combine yesterdays and today's code.
Code:
Sub Main
Dim FileSystem As Object
Dim HostFolder As String
HostFolder = "C:\"
Set FileSystem = CreateObject("Scripting.FileSystemObject")
DoFolder FileSystem.GetFolder(HostFolder)
End Sub
Sub DoFolder(Folder)
Dim SubFolder
For Each SubFolder In Folder.SubFolders
DoFolder SubFolder
Next
Dim File
For Each File In Folder.Files
' Operate on each file
Next
End Sub
Bookmarks