方法一:
Debug.Print LenB(StrConv("access软件网。", vbFromUnicode))
方法二:
你可以尝试用 ASC 去判断,如果是 0-255 则表明是英文,算一个,大于,小于部分都算2个
Function TrueLen(ByVal strA As String) As Long
Dim i As Long
Dim i1 As Long
Dim strB As String
For i = 1 To Len(strA)
strB = Mid(strA, i, 1)
If Asc(strB) >= 0 And Asc(strB) <= 255 Then
i1 = i1 + 1
Else
i1 = i1 + 2
End If
Next
TrueLen = i1
End Function
Function test()
Dim bb As String
bb = "66 上海,.<>2"
Debug.Print TrueLen(bb)
Debug.Print LenB(bb)
End Function