I've used the below mentioned code in an excel solution.
I'm a bit surprised over the speed. It takes about 10 sec. (looong time
to wait) to search through a folder with 2 subfolders, 640 files in all.
What I do is:
- pick up cell-value by dbl-click on cell
- loop through folders for files that starts with cell-value (always 5
car.)
- matches are put in a list box, from where user can pick to open
The For/Each code:
For Each OneFile In F.Files
Debug.Print OneFile.Name
If Left(OneFile.Name, 5) = ActiveCell.EntireRow.Cells(1,
1).Value Then
UserForm1.ListBox1.AddItem OneFile.Path
End If
Next OneFile
A comparable search from explorer takes less than 1 sec.