I would like to loop through the files of a directory using vba in Excel 2010.
In the loop, I will need:
Dir seems to be very fast.
Sub LoopThroughFiles() Dim MyObj As Object, MySource As Object, file As Variant file = Dir("c:\testfolder\") While (file <> "") If InStr(file, "test") > 0 Then MsgBox "found " & file Exit Sub End If file = Dir Wend End Sub