InStr Function [Runtime]
Returns the position of a string within another string.
The Instr function returns the position at which the match was found. If the string was not found, the function returns 0.
InStr ([Start As Long,] Text1 As String, Text2 As String[, Compare])
- Code: Select all Expand viewCollapse view
Dim sInput As String
Dim iPos as Integer
sInput = "Office"
iPos = Instr(sInput,"c")
Function MyTestCondition(A_string, A1word, A2word, B_string, B1word, B2word, CaseParStr as string) as integer
If CaseParStr = "OFF" then CasePar = 1 else CasePar = 0
if ((Instr(1, A_string, A1word, CasePar)<>0) and (Instr(1, B_string, B1word, CasePar)<>0)) then
MyTestCondition = 20
elseif ((Instr(1, A_string, A2word, CasePar)<>0) and (Instr(1, B_string, B2word, CasePar)<>0)) then
MyTestCondition = 10
MyTestCondition = 0
buck1942 wrote:Thanks to the one posting a solution to this Subject (5 YEARS ago ), regarding how to do an "instr/contains"...
Users browsing this forum: No registered users and 2 guests