View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default VBA String manipulation

Try something like the following:


Dim ResStr As String
Dim SrcStr As String

SrcStr = "this is some text"
ResStr = Left(SrcStr, InStr(SrcStr, " ") - 1)
Debug.Print ResStr


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"JayCeeJay" wrote in
message
...
I am trying to manipulate incoming field info that is rather

long-winded. What I wish to do is to diplay in the destination
cells only the data to the Left of the first space (or break in
the string). I realize it probably involves a combination of VBA
functions, but I would be grateful to anyone who could help me
with it.