PDA

View Full Version : Searching through CSV files



NMW
12-11-2007, 10:12 PM
I'm trying to figure out a way to search through a bunch of CSV files and record occurrences of certain words. I found some code from this forum which is almost exactly what I need except one problem. (Code by DRJ) If the word is squished somewhere within a text string it is not found. My CSV files have many URLs in them and I am searching for certain key words within these URLs. Any suggestions on a modification which would allow it to find words within the text? (Great code by the way DRJ!:thumb )

This is the code I was referring to: ...
vbaexpress.com/kb/getarticle.php?kb id=159#instr

Any help would be appreciated. Thanks in advance.

MNW

Bob Phillips
12-12-2007, 01:38 AM
That should do just that, because it uses LookAt:=xlPart in the Find.

NMW
12-12-2007, 02:15 PM
I see my mistake. It seemed like it was not working since it would not find stuff, but that is because it was only looking the xls files. Once I changed the file extension in the code, it searched through all my CSV files which of course found all the occurrences as it was supposed to.

Thanks
NMW