Hey All,
I'm trying to take a string and only copy the first 3 words of it (separated by spaces). I'm 99% of the way there, I just can't figure out where to next the rest of my Do While .... Loops.
[vba]
Private Sub TrimName(text As String)
Dim i As Integer
Dim newText As String
i = 1
Do While Mid(text, i, 1) <> " "
newText = Left(text, i)
i = i + 1
Loop
'this copies the FIRST WORD of my String, I just need the next two:banghead:
End Sub
[/vba]
Thanks all!
BMG