Hello, I find out that InStr only works when the second
string is of length 1 - it only searches the first
character -
is there any equivalent that searches the whole word?
Not True! InStr() searches the entire string from the first character
to the end, unless you specifically tell it to search from a different
start point.
See VBA Help for all the InStr() arguments.
i Want to know if a string is already contained in another
example:
strSearchIn = "Hello;GoodBye;Hola;Adios;Gruzi;Tschus"
strSearchFor = "Adios"
I want to get a True or something to tell me that "Adios"
is on strSearchIn and a False to tell me that "Ciao" is
not int strSearchIn.
Any ideas?
Dim intX as Integer
Dim strSearchIn as String
strSearchIn = "Hello;GoodBye;Hola;Adios;Gruzi;Tschus"
intX = InStr(strSearchIn,"Adios")
If intX = 0 then
MsgBox "Not in string"
Else
MsgBox "In string"
End If