The great function InStr I use a lot has a small confusing part.
Which string comes first? and which second?
The SearchIN? or the SearchFor?
I got confused, so this post is merely to remind me how to use it.
Function VBInstr(SearchFor, SearchIn, Optional StartSearch = 1, Optional SearchCompare = vbBinaryCompare)
VBInstr = InStr(StartSearch , SearchIn, SearchFor , SearchCompare )
End Function
' I always forget which string comes first, the searchin, or the searchfor?
' So, I thought I got it here online for my references
InStr([start,] SearchIn, SearchFor [,compare] )
InStr([start,] BigString, SmallString [,compare] )
InStr([start,] string1, string2 [,compare] )
string1 Required. String expression being searched.
string2 Required. String expression sought.
VBInstr = InStr(StartSearch , SearchIn, SearchFor , SearchCompare )
End Function
' I always forget which string comes first, the searchin, or the searchfor?
' So, I thought I got it here online for my references
InStr([start,] SearchIn, SearchFor [,compare] )
InStr([start,] BigString, SmallString [,compare] )
InStr([start,] string1, string2 [,compare] )
string1 Required. String expression being searched.
string2 Required. String expression sought.
SearchFor, SearchIn, Optional StartSearch = 1, Optional SearchCompare
Views 3,346
Downloads 1,091
CodeID
DB ID
ANmarAmdeen
609
Revisions
v3.0
Friday
April
22
2022