View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_5_] Jim Thomlinson[_5_] is offline
external usenet poster
 
Posts: 486
Default Splitting a String

There are a couple of ways to do this.

lastWord = right(longString, len(longString) - Find(" ", longString) + 1)

or

lastWord = mid(longString, Find(" ", longString) + 1, 256)

--
HTH...

Jim Thomlinson


"AMK4" wrote:


I need to split a string into two parts: the first word, and whatever's
left of the remaining string. I do this to capture the first word:
Code:
--------------------
firstWord = Left(longString, Find(" ", longString) - 1)
--------------------
... however I don't know what's the easiest (smartest?) way to figure
out the remaining part of the string.


--
AMK4
------------------------------------------------------------------------
AMK4's Profile: http://www.excelforum.com/member.php...o&userid=19143
View this thread: http://www.excelforum.com/showthread...hreadid=511600