掌握excel设置小数点保留位数的多种实用技巧与方法
841
2022-12-02
excel提取字符串中数字、中文、英文字符的自定义函数
Function MyGet(Srg As String, Optional n As Integer = False)‘n为1,取汉字,n为2,取字母,n为0,取数字Dim i As IntegerDim s, MyString As StringDim Bol As Boolean
For i = 1 To Len(Srg)s = Mid(Srg, i, 1)If n = 1 ThenBol = Asc(s) < 0 ‘文字ElseIf n = 2 ThenBol = s Like "[a-z,A-Z]" ‘字母ElseIf n = 0 ThenBol = s Like "#" ‘数字End IfIf Bol Then MyString = MyString & sNext
MyGet = IIf(n = 1 Or n = 2, MyString, Val(MyString))
End Function
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。