What is best method to merge / combine multiple folder paths into one

sp00kster

New Member
Joined
Nov 25, 2006
Messages
42
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

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:

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top