ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Is it possible to export a list of numbers from excel to a windows search ? (https://www.excelbanter.com/excel-discussion-misc-queries/87961-possible-export-list-numbers-excel-windows-search.html)

SW Monkey

Is it possible to export a list of numbers from excel to a windows search ?
 
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

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


SW Monkey

Is it possible to export a list of numbers from excel to a windows search ?
 

Bryan Hessey wrote:
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


Hello Bryan,

What I am doing is exporting a list of part numbers from our inventory
system into Excel. These part numbers have correspoding drawings in a
certain directory. I would like to somehow import the list from Excel
into a windows search. After finding the files, I woud copy the files
to another directory.

The way I currently do this is export the list from excel to notepad,
then create a string of part numbers to paste in the windows search.

Ex.
Excel list
120
121
122
123
124
125

Notepad list
120, 121, 122, 123, 124, 125

Copy/Paste into Windows Search



All times are GMT +1. The time now is 06:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com