参考一下
Function TQ(rng As Range, Optional i As String = "数字")
With CreateObject("vbscript.regexp")
Select Case i
Case "数字": .Pattern = "\d"
Case "字母": .Pattern = "[a-zA-Z]"
Case "汉字": .Pattern = "[\u4e00-\u9fa5]"
End Select
.Global = True
Set matches = .Execute(rng.Value)
For Each Match In matches
a = a & s & Match
Next
TQ = IIf(Len(a) > 0, a, "")
End With
End Function