Built-In File Search (may only work in Excel XP):   Return to List

' Excel_FileSearch searches for all Excel Workbooks in the working directory and displays the total.
' Alternative can use the Scripting Runtime add-in

Public Sub Excel_FileSearch()
    Dim x As Integer
    With Application.FileSearch
        .LookIn = ThisWorkbook.Path
        .FileName = "*.xls"
        If .Execute > 0 Then
            MsgBox .FoundFiles.Count & " workbooks were found."
            For x = 1 To .FoundFiles.Count
                MsgBox .FoundFiles(x)
            Next x
        Else
            MsgBox "No workbooks were found."
        End If
    End With
End Sub



Note to Webmaster