Private Sub Command1_Click() 'a = "a12a2a2a2a2a124542" a = "1222212中12121212" If LenB(StrConv(a, 128)) <> Len(a) Then MsgBox "yes" Else MsgBox "no" End IfEnd Sub
另外一种方法,For i = 1 To Len(s) If Asc(Mid(s, i, 1)) < 0 Or Asc(Mid(s, i, 1)) > 255 Then MsgBox "有中文" Next
'a = "a12a2a2a2a2a124542"
a = "1222212中12121212" If LenB(StrConv(a, 128)) <> Len(a) Then MsgBox "yes"
Else
MsgBox "no"
End IfEnd Sub
If Asc(Mid(s, i, 1)) < 0 Or Asc(Mid(s, i, 1)) > 255 Then MsgBox "有中文"
Next