View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Mark1 Mark1 is offline
external usenet poster
 
Posts: 6
Default Move names from Search to Excel

Ron,
One more thing, and it might be a biggie. I need to list out files where
the contents contain "X", not the actual file name. This is what I tried
before your original reply:

C:\FINDSTR /M "X*" \\MYSERVER\MYPATH

but with no luck. I'm going to try to incorporate what you wrote earlier
and see what I get. In the meantime, if you have the modification that would
be great.


"Ron Coderre" wrote:

You're very welcome...Thanks for the feedback.

(It's not often that I have to sort through my mind's seldom used DOS closet
looking for not quite forgotten commands!)

***********
Regards,
Ron

XL2002, WinXP


"Mark1" wrote:

Thank you Ron, that is exactly what I needed. I was going through DOS help
webpages trying to find the exact syntax. Thanks again!

"Ron Coderre" wrote:

Maybe this quick non-vba solution?
(it's a lot easier to do than to describe)

Open notepad and enter a line similar to this:
dir/b \\MyServer\MyFolder\*X*.xl* c:\MyFileList.txt

Save the notepad file on your Desktop as ListFiles.BAT

Double-click that file to run it and create the list

Open the C:\MyFileList.txt file and copy the list into Excel
or just import it into Excel

-----------------
Notes:
dir/b :is the command to list files (excluding headings, details, and
summaries)

\\MyServer\MyFolder\*X*.xl* :indicates where to look and what to list.
In this case, it looks in the MyFolder folder of the MyServer server for
Excel files whose file name contains an "X". You'll enter the correct
location. If you are searching your C:drive, you'd use this version of the
command:
dir/b C:\MyFolder\*X*.xl* c:\MyFileList.txt

This section: c:\MyFileList.txt
is the command to write the search results to a text file named
MyFileList.txt and store that file in the root of the C: drive.
-----------------


Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"Mark1" wrote:

I did a search in windows explorer for all files that contain the text "X".
I want to be able to move the list of named files to an excel worksheet. In
other words, if my search results displayed these files containing the text
"X":
ABCD
EFGH
IJKLM

I want my Excel spreadsheet to look like this:
ABCD
EFGH
IJKLM

Thanks for the help!