filesearch!

O

office_operator

Sub a1()
With Application.FileSearch
.LookIn = "C:\"
.FileName = "1.txt"
If .Execute > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If
End With
End Sub


The results are "1.txt,12.txt,11.txt..."
but I just want the results is" 1.txt"
help me!
thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top