如果条件如何制作?

时间:2019-06-07 23:32:18

标签: vba

我想知道是否可以创建一个If条件,以检查变量“ a”是否包含字符串“ pass”,然后显示错误消息?

dim a as string
a = textbox1.text
if a = "pass" then
label1.text = "Error: you can't use the word PASS in your password"
end if

1 个答案:

答案 0 :(得分:0)

dim a as string
a = textbox1.text
if InStr("fkvnfdpassknfd", "pass") > 0 then
label1.text = "Error: you can't use the word PASS in your password"
end if