Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help! Searching for text with more than one criteria


Hi,

I have a text file that is formatted in a way like this:

Department #
Responsible person:
labor distribution

Here is my code so far:

Sheets("Sheet3").Select
Range("A1").Select
Open "C:\Documents and Settings\Kevin\desktop\ebc440.txt" For Input
As #1
texttofind = "DEPARTMENT 33290"
Do Until EOF(1)
Line Input #1, data
If InStr(1, data, texttofind) Then
ActiveCell.Offset(r, 0) = data
r = r + 1
End If
Loop
Close

How do I code it so that I can add more criteria like "labor" and
"responsible person" and not just the department 33290". Please help,
thanks in advance!


--
Sethaholic
------------------------------------------------------------------------
Sethaholic's Profile: http://www.excelforum.com/member.php...o&userid=25113
View this thread: http://www.excelforum.com/showthread...hreadid=387995

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching for Data of a certain criteria jinga Excel Discussion (Misc queries) 3 August 1st 10 04:21 AM
Formula for searching 3 criteria Craig Excel Discussion (Misc queries) 4 February 18th 09 01:22 PM
Formula for searching 3 different Criteria Craig Excel Discussion (Misc queries) 1 February 9th 09 04:34 PM
Searching for records with multiple criteria Jeff Excel Worksheet Functions 7 December 11th 08 10:07 PM
Help! Searching for text with more than one criteria optionbase1 Excel Programming 0 July 18th 05 03:48 PM


All times are GMT +1. The time now is 07:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"