-
I would like to make an If statement that looks for a certain letter or word in a label even if there are several words or letters in that label. Such as
If txtName = (a word or letter in a label) Then
Whatever happens(doesnt matter)
End If
How would I do this?
If you need clarification just reply.
Thanks a bundle,
Marc
-
In a label?
Do you mean a TextBox? or really a label?
Try the Split() command
... :) ...
-
I want to see if what a user typed in a text box is located in a label.
What is the split command?
Thanks,
Marc
-
The Split function can take a string and return an array:
Code:
Private Sub Form_Load
Dim TestString as string
Dim a() as string
dim i as integer
TestString = "This is a Test"
a = Split(TestString)
For i = lbound(a) to Ubound(a)
MsgBox a(i)
Next
End
End Sub