View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JustinP JustinP is offline
external usenet poster
 
Posts: 9
Default Search for file with *. extensions

I need to search for files with the extensions "*.mxd" and "*.wor". How
can I do this using the code below with duplicating it all?

Sub FindFiles()
Dim i As Long
With Application.FileSearch
.SearchSubFolders = True
.LookIn = "C:\"
.Filename = "*.mxd"
.FileType = msoFileTypeAllFiles
.Execute
For i = 1 To .FoundFiles.Count
Range("A" & i) = .FoundFiles(i)
Next
End With
End Sub