如何有效缩小Excel文件大小提升工作效率与存储空间
383
2022-10-07
用自定义函数获取文本中的信息
本文为《别怕,Excel VBA其实很简单(第3版)》随书问题参-
以下过程供参考:
Function MidS(ByVal txt, n As Byte) As String Application.Volatile True Dim T As String, i As Long Dim NumStr As String, EnStr As String, Other As String For i = 1 To Len(txt) T = Mid(txt, i, 1) If T Like "[0-9]" Then NumStr = NumStr & T ElseIf T Like "[A-z]" Then EnStr = EnStr & T Else Other = Other & T End If Next i If n = 0 Then MidS = NumStr ElseIf n = 1 Then MidS = EnStr ElseIf n = 2 Then MidS = Other Else MidS = "#参数错误!" End IfEnd Function
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。