1.以MID跑迴圈取字,再逐一比對:
Sub 全型字元數1()
Dim j%, Jm%, T$
For j = 1 To Len([A1])
T = Mid([A1], j, 1)
If T <> Evaluate("LeftB(""" & T & """,1)") Then Jm = Jm + 1
Next j
MsgBox "全型字共有:" & Jm & " 個"
End Sub
2.不用迴圈:
Sub 全型字元數2()
Dim X1%, X2%
X1 = Len([A1])
X2 = Evaluate("Len(LeftB(""" & [A1] & String(X1, "1") & """," & X1 * 2 & "))")
MsgBox "全型字共有:" & X1 * 2 - X2 & " 個"
End Sub