Dir
takes wild cards so you could make a big difference adding the filter for test
up front and avoiding testing each fileSub LoopThroughFiles()
Dim StrFile As String
StrFile = Dir("c:\testfolder\*test*")
Do While Len(StrFile) > 0
Debug.Print StrFile
StrFile = Dir
Loop
End Sub
No comments:
Post a Comment