I have a clumsy search utility that currently searches though thousands of files and works well though also searches through moot directories and is very slow. I need to find a way to select more targeted file folders. What is the best avenue to combine or merge multiple targeted paths into one - or is it even possible without starting all over? Any help would be much appreciated
I am bad at Excel but learning
VBA Code:
Sub GetFiles()
Application.ScreenUpdating = False
Sheets("Sheet1").Unprotect Password:=""
Dim Root As String
Dim fPath As String
Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
Root = Environ("USERPROFILE") & "\Dropbox" 'Dropbox root
fPath = Root & Application.PathSeparator & "Prefab\" 'current path
'target path needed = Root & Application.PathSeparator & "Prefab\User1\PrefabOrders\"
'target path needed = Root & Application.PathSeparator & "Prefab\User1\Archive\"
'target path needed = Root & Application.PathSeparator & "Prefab\User2\PrefabOrders\"
'target path needed = Root & Application.PathSeparator & "Prefab\User3\PrefabOrders\"
If fPath <> "" Then
Set fso = New Scripting.FileSystemObject
If fso.FolderExists(fPath) <> False Then
Set SourceFolder = fso.GetFolder(fPath)
IsSubFolder = True
Call ListFiles(SourceFolder, IsSubFolder)
Else
MsgBox "Path Does Not Exist"
End If
Else
MsgBox "Path Can not be Empty"
End If
Sheets("Sheet1").Protect Password:=""
Application.ScreenUpdating = True
SearchForm.Show
End sub
I am bad at Excel but learning
Last edited: