View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bryan Hessey
 
Posts: n/a
Default Is it possible to export a list of numbers from excel to a windows search ?


Not to my knowledge, but what do you want to do with the files when you
find them?
You can modify a little VB code to process your list and do a file
search to produce a list.

Code that I currently use to list all .xls files within a folder is:


Code:
--------------------
Sub ListFiles()

Dim fs As FileSearch
Dim i, iLastRow
Dim sFileType As String
sFileType = "xls"

Set fs = Application.FileSearch

Range("A1").Select
If Range("A1").Value < "" Then sFileType = Range("A1").Value

iLastRow = Range("A65536").End(xlUp).Row
Range("A2:A" & iLastRow).EntireRow.Delete

With fs
.NewSearch
.LookIn = InputBox("Enter the path of the folder containing the required files", "Enter a Path", "C:\Valley\Test\")
.SearchSubFolders = True
.Filename = "*." & sFileType

If .Execute(SortBy:=msoSortByFileName, SortOrder:=msoSortOrderAscending) 0 Then
For i = 1 To .FoundFiles.Count
Range("A1").Offset(i, 0).Value = .FoundFiles(i)
Next
Debug.Print
Debug.Print "Files="; .FoundFiles.Count
Else
MsgBox "No files of the type " & sFileType & " were found"
End If

End With

End Sub
--------------------


which searches either for .xls or for a filetype entered in A1 to
produce a (new) list from A2 onwards.

Does this idea help?

--

SW Monkey Wrote:
I have a list of part numbers that have corresponding files on a
network drive. I am trying to figure out a way to export the list
from
excel and have windows automatically search for these numbers.

Is this possible?



--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059
View this thread: http://www.excelforum.com/showthread...hreadid=540846