Login | |
|
 |
RE: InStr() - Help needed pulling additional info.... - 5/24/2007 4:53:47 AM
|
|
 |
|
| |
ebgreen
Posts: 5250
Score: 31
Joined: 7/12/2005
Status: offline
|
I'm a little confused. Do you only want to get the first two letters of FRED, or the first two letters of every string? Either way, to get the first two letters: strFirstTwo = Left(sLinkName, 2)
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: InStr() - Help needed pulling additional info.... - 5/24/2007 4:56:17 AM
|
|
 |
|
| |
Country73
Posts: 735
Score: 10
Status: offline
|
You should be able to get what you want by adding another INSTR function with AND - IF INSTR(LCASE(sFilter),"-1") AND INSTR(LCASE(sFilter),"fr")THEN INSTR FUNCTION - INSTR([start (optional),] string1 (required), string2 (required)[, compare (optional)]) or better yet, use what ebgreen posted IF LEFT(LCASE(sFilter),2) = "fr" AND INSTR(sFilter,"-1") THEN
< Message edited by Country73 -- 5/24/2007 4:58:04 AM >
|
|
| |
|
|
|
 |
RE: InStr() - Help needed pulling additional info.... - 5/24/2007 7:21:48 AM
|
|
 |
|
| |
ebgreen
Posts: 5250
Score: 31
Joined: 7/12/2005
Status: offline
|
quote:
if the string looks like this "MAN-FRED-1" How much will it look like that? Will just the number change? If so, how much? At a guess: arrParts = Split(sLinkName, "-") strFirstTwoLetters = Left(arrParts(1), 2) strNumber = "-" & arrParts(2)
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
| |
|
|
 |
|
 |
|
|