Searching for mutiple items in txt files

M

Michael Wise

I am searching a virtual printer for txt files with specific informatio
in them. I would however like for it to search for today's date as on
of 3 criteria's. Current code below is what i'm using but I have no
found a solution to getting it to see the date. FYI the report wil
contain the date as such 16-AUG-04 in txt. Any help here?

With Application.FileSearch
.NewSearch
.LookIn = "X:"
.TextOrProperty = "U246984 PCE REPORT"
.MatchTextExactly = False
.Filename = "*.txt"
.Execut
 
D

Dave Peterson

I looked through help. I didn't see anything that said you get up to 3
criteria. Did I miss something?

..textorproperty = format(date,"dd-mmm-yy")

might work for you.

The other thing is that if your date is in a cell, and it's just formatted to
show dd-mmm-yy, it might not work at all.

I'd be very surprised to see filesearch find a date this way.

But if you actually had text in the cell '16-AUG-04
note leading apostrophe, then I bet it would work ok.

(all this is untested.)
 
M

Michael Wise

Thanks Dave,
But I have tried the format(dd-mmm-yy) did not work it caused it t
bypass all together. The file it is searching is still in text form an
so the date represented within that files date is formated dd-mmm-yy.
have even tried assigning a variable as well did not work there either


Other suggestions?

Michae
 
D

Dave Peterson

If you do file|open, you can click on search (it's under Tools in xl2002).

Maybe you could search there and see if that helps. But if I put 08/19/2004 in
a cell (formatted for dd-mmm-yy) and then search for 19-aug-04, it didn't find
it.

Maybe you could search for the same format as your pc's short date format.

If you're not tied to VBA, maybe you could use Windows start button|search to
find it.
 
Top