Simpler than I expected
I added a parameter [Filemask()] to the function and then modified
for j as Int32 = 0 to d.Ubound
Files.Append d(j)
next
To
for j as Int32 = 0 to d.Ubound
For q as Integer=0 To FileMask.Ubound
If d(j).Right(3)=FileMask(q) Then Files.Append d(j)
next
next
The added parameter needs to be included in the call within the loop as well.
Overall, there’s an barely perceptible drop in execution speed which is absolutely tolerable. With 25k files it added less than .5 seconds.
Once again, many thanks Julian, I would have been struggling for days without your help!