在excel中用正则表达式查出一列中含有汉字的数据

要求在excel中求A 列 中含有中文的数据过滤显示出来,A中的数据大部分是纯英文的,想找出中英文混杂的 ,要用正则表达式做,本人一点不懂,希望答案尽量详细,谢谢

=LENB(A1)-LEN(A1)

B列输入上公式,回车,下拉,结果非0的就是

追问

要在vba中用正则表达式做 怎么做呀

温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-11-14
Function test(rng)
Dim regx As Object
Dim strs, str, i
Set regx = CreateObject("vbscript.regexp")
With regx
    .Global = True
    .Pattern = "[\u4e00-\u9fa5]"
    Set strs = .Execute(rng)
    For Each i In strs
        str = str & i
    Next
    If Len(str) > 0 Then
        test = "有中文"
    Else
        test = ""
    End If
End With
End Function

试试吧~~

本回答被提问者采纳