T
terry b
Hello, all
[Using the simple example from the vba help files, the following
returns 9:]
Sub StringPractice()
Dim SearchString, SearchChar, MyPos
SearchString = "XXpXXpXXPXXP" ' String to search in.
SearchChar = "P" ' Search for "P".
' A binary comparison starting at position 1. Returns 9.
MyPos = InStr(1 , SearchString, SearchChar, 0)
MsgBox MyPos
End Sub
Obviously the first occurrence of "P" is in the 9 pos when starting at
beginning of SearchString... BUT WHY, when I substitute any other
number for a starting position, click on reset, then run sub again,
does the answer ALWAYS RETURN A 9??? Does the constant vbBinaryCompare
not support the use a starting-position number w/ InStr???
Thanks much for your time [)
terry b.
[Using the simple example from the vba help files, the following
returns 9:]
Sub StringPractice()
Dim SearchString, SearchChar, MyPos
SearchString = "XXpXXpXXPXXP" ' String to search in.
SearchChar = "P" ' Search for "P".
' A binary comparison starting at position 1. Returns 9.
MyPos = InStr(1 , SearchString, SearchChar, 0)
MsgBox MyPos
End Sub
Obviously the first occurrence of "P" is in the 9 pos when starting at
beginning of SearchString... BUT WHY, when I substitute any other
number for a starting position, click on reset, then run sub again,
does the answer ALWAYS RETURN A 9??? Does the constant vbBinaryCompare
not support the use a starting-position number w/ InStr???
Thanks much for your time [)
terry b.