Is there a way to find out if a textbox contains a certain word or sentance? :)
Thank you
Printable View
Is there a way to find out if a textbox contains a certain word or sentance? :)
Thank you
Yes, the InStr function.
If InStr(Text1.Text, "hello world") Then...
by the way is there a way to make it so caps do not matter?
If InStr(UCase(Text1.Text), "HELLO WORLD") Then...
or
That will take care of upper and lower case letters.Code:If InStr(1,Text1.Text,"X",vbTextCompare) Then
MsgBox "The letter 'X' is in Text1!"
End If