用自定义函数吧
Function tiqu(cl1 As Range, cl2 As Range)
Dim reg As Object, mhs
Dim strTmp As String
tiqu = ""
If cl1.Value = "" Or cl2.Value = "" Then
Exit Function
End If
strTmp = Replace(cl2.Value, "+", "+")
Set reg = CreateObject("vbscript.regexp")
With reg
.Pattern = "(d+(.d+)?)*" & strTmp
.Global = True
.IgnoreCase = True
Set mhs = .Execute(cl1.Value)
If mhs.Count = 0 Then
Exit Function
Else
tiqu = mhs(0).submatches(0)
End If
End With
End Function
Alt+F11》弹出窗口中,选插入》模块》粘贴以上代码,关闭窗口,excel中输入公式=tiqu($A2,B$1)右拉再下拉