打开Excel,按下Alt+F11
插入 -- 模块 -- 粘贴如下公式
ide
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) 引用和计算lua