Look in the vba help index for DIR
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"dstiefe" <(E-Mail Removed)> wrote in message
news:0911EE2B-C472-40FD-9F14-(E-Mail Removed)...
> someone had given me this code... (see below)...but the "filesearch"
> option
> does not pop up when I start typing the code.. I am using 2007
> version...will
> that make a difference?
>
> Thank you
>
> Here is another method
>
> Sub test()
> folder = "c:\temp"
>
> Set FS = Application.FileSearch
> With FS
> .NewSearch
> .LookIn = folder
> .SearchSubFolders = False
> '.Filename = "Run"
> '.MatchTextExactly = True
> .FileType = msoFileTypeExcelWorkbooks
>
> FileCount = .Execute
>
> If FileCount > 0 Then
> MsgBox "There were " & .FoundFiles.Count & _
> " file(s) found."
> Else
> MsgBox "There were no files found."
> End If
>
> End With
>
>
> End Sub
>
>
>