打開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