If Len(sTemp) = LenB(sTemp) Then
        MsgBox "E文"
    Else
        MsgBox "中文"
    End If

解决方案 »

  1.   

    要准确地统计字数,可逐一将字符串转换为ASCII码,依据其值判断是为中文字符还是英文字符。0——127之间的为大小写字母及数字、半角标点符号、回车、换行等,中文字符的ASCII值则不在0——127之列了。这样,纯汉字的字数统计是很容易的,
    Private Sub StatisticString()
       Dim C_Word As Long, E_Word As Long  '中英文字数
       Dim Str As String '总字符
       Dim FileLine As Long
       Dim FileString As String
       Dim K As Long  '计数器
       Dim tmpStr As String '逐一检测的字符   C_Word = 0: E_Word = 0: M_Word = 0: K = 0: s = 0: FileLine = 0 '清空变量
       Str = RichTextBox1.Text & " " '加一空格便于意外时计算最后一个字符
       
       For K = 1 To Len(Str) - 1
          DoEvents
          tmpStr = Mid$(Str, K, 1)
          If Asc(tmpStr) >= 65 And Asc(tmpStr) <= 122 Then E_Word = E_Word + 1
          If Asc(tmpStr) > 127 Or Asc(tmpStr) < 0 Then C_Word = C_Word + 1
          If Asc(tmpStr) = 13 Then FileLine = FileLine + 1
       Next K
    End Sub
      

  2.   

    if asc("String")<0 then
        msgbox("Chinese")
    else
        msgbox("English")
    endif
      

  3.   

    楼上的说得对,汉字的ASC码是负数,用这判断就好了,套打的时候精确定位很重要哟
      

  4.   

    if Len(str) < LenB(StrConv(str, vbFromUnicode)) then
       Msgbox str & "是中文字符"
    else
       Msgbox str & "英文字符"
    end if