This is a simple function that I wrote that will return the text found between 2 strings.
VB Code:
Public Function FindBetween(strContext As String, strStart As String, strEnd As String, Optional StartFrom As Long = 1) As String
Dim strtPt As Long
Dim ndPt As Long
If StartFrom = 0 Then
FindBetween = vbNullString
Exit Function
End If
strtPt = InStr(StartFrom, strContext, strStart) + Len(strStart)
ndPt = InStr(strtPt, strContext, strEnd) - strtPt
If ndPt = -strtPt Then
FindBetween = vbNullString
Exit Function
End If
FindBetween = Trim$(Mid$(strContext, strtPt, ndPt))
End Function
You can call it like this
VB Code:
Dim Context As String, Result As String
Context = "<b>Hello!</b>"
Result = FindBetween(Context, "<b>", "</b>")
MsgBox Result
And Result will = "Hello!"