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

"JustinP" skrev i en meddelelse
ups.com...
I mean *without* duplicating it...


JustinP wrote:
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



Hi Justin

Using semicolon
..Filename = "*.mxd;*.wor"
will do the job.


--
Best regards
Leo Heuser

Followup to newsgroup only please.