Function GetDelimitedText(Text As String, OpenDelimiter As String, _ CloseDelimiter As String, index As Long) As String Dim i As Long, j As Long If index = 0 Then index = 1 i = InStr(index, Text, OpenDelimiter, vbTextCompare) If i = 0 Then index = 0 Exit Function End If i = i + Len(OpenDelimiter) j = InStr(i + 1, Text, CloseDelimiter, vbTextCompare) If j = 0 Then index = 0 Exit Function End If GetDelimitedText = Mid$(Text, i, j - i)
index = j + Len(CloseDelimiter) End Function |