How to find the next word in a sub string
Posted on January 5, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 'String Manipulation - How to find the next word in a sub string Public Function FindNextWord(ByRef sText As String, ByRef sFind As String) As String Dim sWord() As String Dim lX As Long sWord = Split(sText, " ") For lX = 0 To UBound(sWord) If sWord(lX) = sFind Then If lX < UBound(sWord) Then FindNextWord = sWord(lX + 1) Exit For End If End If Next End Function |