View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tony Tony is offline
external usenet poster
 
Posts: 5
Default Scanning Text files for specific words

I have a problem with trying to find specific text within a set of txt
files. I have a directory with 15 generic text files in it. I am
supplied with a very unique number that I have to match to one of the
text files, however I don't know which one of the 15 it may be. I'm
not referring to the filename.txt file, but a string of text within
the text file. The filename.txt file contains my unique number inside
it.

Is there an easy VBA way to scan the 15 txt files and open the one I
want based on the number I'm given, open the text file to pull the
data from it into a spreadsheet?

Once I get this figured out - I have to do the exact same thing to a
spreadsheet file. The same unique number I'm give is also associated
with a spreadsheet in a directory (along with many others). I'll
need to open that spreadsheet and extract the data.

The commonality is the unique number inside the files. Any help or
pointers would be appreciated.

-Tony