VBA 常用自定义截取函数smid
作者:
七彩色工作室 | 来源:发表于
2017-06-23 10:35 被阅读0次Public Function smid(ostr, lstr As String, rstr As String)
'Debug.Print ostr
'Debug.Print lstr
'Debug.Print rstr
If InStr(ostr, lstr) <= 0 Or InStr(ostr, rstr) <= 0 Then
smid = ""
Else
iStart = InStr(ostr, lstr) + Len(lstr)
iEnd = InStr(iStart, ostr, rstr)
Debug.Print "iStart:" & iStart
Debug.Print "iEnd:" & iEnd
smid = Mid(ostr, iStart, iEnd - iStart)
End If
' Debug.Print smid
End Function
本文标题:VBA 常用自定义截取函数smid
本文链接:https://www.haomeiwen.com/subject/yzzqcxtx.html
网友评论