Private Function MidText(ByVal strText As String, ByVal Find1 As String, ByVal Find2 As String, Optional ByVal lStart As Long = 1, Optional ByVal Compare As VbCompareMethod = vbBinaryCompare) As String Dim lRet As Long, sRet As String lRet = InStr(lStart, strText, Find1, Compare) If lRet Then sRet = Mid$(strText, lRet + Len(Find1)) lRet = InStr(1, sRet, Find2, Compare) If lRet Then MidText = Left$(sRet, lRet - 1) End If End If End Function
Use : MidText(text1.text,"a","b")
ไม่มีความคิดเห็น:
แสดงความคิดเห็น