ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA String manipulation (https://www.excelbanter.com/excel-programming/293497-re-vba-string-manipulation.html)

Chip Pearson

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.




All times are GMT +1. The time now is 06:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com