标签:excel vba
打开Excel,按下Alt+F11
插入 -- 模块 -- 粘贴以下公式
Function getcn(mystr As Range)
‘提取中文以及全角字符
Dim temp As String
getcn = ""
For i = 1 To Len(mystr)
temp = Mid(mystr, i, 1)
If Evaluate("LenB(""" & temp & """)") = 2 Then
getcn = getcn & temp
End If
Next
End Function然后在Excel中通过公式 =getcn(A1) 引用和计算
本文出自 “foolishfish” 博客,请务必保留此出处http://foolishfish.blog.51cto.com/3822001/1618783
标签:excel vba
原文地址:http://foolishfish.blog.51cto.com/3822001/1618783