ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help! Searching for text with more than one criteria (https://www.excelbanter.com/excel-programming/334822-re-help-searching-text-more-than-one-criteria.html)

optionbase1

Help! Searching for text with more than one criteria
 

you can use the AND function in the IF statement at the top to defin
multiple instances of the INSTR(...) test (or the OR function etc..)


i.e.

If InStr(1, data, texttofind) AND InStr(1, data, texttofind2) Then
...
...
ENDIF

where texttofind2 is your second search criteria.

if you want to seach for a string but don't know what you will b
looking for when writing the code then a simple INPUT box statement ca
receive you text without the need for a dialogbox with all th
associated code:

texttofind = INPUTBOX ("Enter Search Text"

--
optionbase
-----------------------------------------------------------------------
optionbase1's Profile: http://www.excelforum.com/member.php...fo&userid=2521
View this thread: http://www.excelforum.com/showthread.php?threadid=38799



All times are GMT +1. The time now is 06:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com