Dim myStr As String
Dim Result As String
myStr = [A2]
Result = Left(myStr, InStr(InStr(1, myStr, " ") + 1, myStr, " ", vbTextCompare)-1)
or as a VBA Function
Code:
Function First2Words(myStr As Variant) As Variant
First2Words = Left(myStr, InStr(InStr(1, myStr, " ") + 1, myStr, " ", vbTextCompare) - 1)
End Function
Dim myStr As String
Dim Result As String
myStr = [A2]
Result = Left(myStr, InStr(InStr(1, myStr, " ") + 1, myStr, " ", vbTextCompare)-1)
or as a VBA Function
Code:
Function First2Words(myStr As Variant) As Variant
First2Words = Left(myStr, InStr(InStr(1, myStr, " ") + 1, myStr, " ", vbTextCompare) - 1)
End Function
Just an curious question, how to get syntax highlighted by putting code in CODE & /CODE tags. Is it inbuilt feature of Xen foro or you have added any addon.
Actually i am also looking for this features in my Xen Foro forum .
Appreciate if you could help me on this.