vb Code:
  1. Public Function GetBetween(ByVal sSearch As String, ByVal sStart As String, ByVal sStop As String, _
  2.                           Optional ByVal lSearch As Long = 1, Optional ByVal bCaseSensitive As Boolean = True) As String
  3. Dim lStart As Long, lStop As Long
  4. Dim lenStart As Long
  5.     lenStart = Len(sStart)
  6.     If bCaseSensitive = False Then
  7.         lStart = InStr(lSearch, sSearch, sStart, vbTextCompare) + lenStart
  8.         lStop = InStr(lStart, sSearch, sStop, vbTextCompare)
  9.     Else
  10.         lStart = InStr(lSearch, sSearch, sStart) + lenStart
  11.         lStop = InStr(lStart, sSearch, sStop)
  12.     End If
  13.         If (lSearch + lenStart) <= lStart Then
  14.             If lStart < lStop Then
  15.                 GetBetween = Mid$(sSearch, lStart, (lStop - lenStart - 1))
  16.                 Exit Function
  17.             End If
  18.         End If
  19.     GetBetween = vbNullString
  20. End Function

I am looking to make this as efficient as possible. =]