InStr(str1,str2)返回字符串str2在str1中首次出现的位置,如果返回值为0 ,则表示在str1中不存在str2。
If InStr(TextBox1.Text, ComboBox6.Text) = 0 Then
TextBox1.Text = TextBox1.Text + ComboBox6.Text + Space(7)
ComboBox6.Text = ""
Else
MsgBox ("包含")
End If
space(num) 表示生成num 个空格。