代码如下
Option Compare Text '以文本方式比较,不区分大小写(此语句必须写在所有过程之前,不可以在Sub中定义,否则报错)
Sub Test()
Dim T1 As String, T2 As String, T3 As String
T1 = "Yuanzifan.com"
T2 = "YuanZIFAN.COm"
T3 = "YuAnZiFaN.CoM"
If T1 Like T2 = True Then MsgBox "True" '使用like而不是“=”
If T2 Like T3 = True Then MsgBox "True"
If T2 Like T3 = True Then MsgBox "True"
End Sub
文章源自原紫番博客-https://www.yuanzifan.com/1316.html
站长微信
扫码添加(注明来意)
Yuanzifan99
原梓番博客公众号
博客内容精选
原梓番博客
评论