【excel VBA】中英文分割

'中文
Function SplitStringChs(TheString)
      Dim n, Chs
      For n = 1 To Len(TheString)
        If Asc(Mid(TheString, n, 1)) < 0 Then
          Chs = Chs & Mid(TheString, n, 1)
        End If
      Next
      SplitStringChs = Chs
    End Function
'英文
Function SplitStringEng(TheString)
    Dim n, Eng
    For n = 1 To Len(TheString)
      If Asc(Mid(TheString, n, 1)) >= 0 Then
        Eng = Eng & Mid(TheString, n, 1)
      End If
    Next
    SplitStringEng = Trim(Eng)
End Function
已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页