I found a UDF that extracts a word at a time, how do I change the code to extract 2 words at a time?
many many thanks
many many thanks
Code:
Function findword(Source As String, Position As Integer)
Dim arr() As String
arr = VBA.Split(Source, " ")
xCount = UBound(arr)
If xCount < 1 Or (Position - 1) > xCount Or Position < 0 Then
findword = ""
Else
findword = arr(Position - 1)
End If
End Function