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
网友评论