ExcelBanter

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

Frank Kabel

VBA String manipulation
 
Hi
try
left(your_str,InStr(your_str," ")-1)

--
Regards
Frank Kabel
Frankfurt, Germany
"JayCeeJay" schrieb im
Newsbeitrag ...
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.


JayCeeJay

VBA String manipulation
 
your_str represents what? The range of cells that contain the run-on text?? I'm confused about how toopen the vba window and where to insert the code.

Frank Kabel

VBA String manipulation
 
Hi
o.k. I thought you alreday had some code for which you only want to add
some string manipulation. your_str is dummy variable for which you have
to assign for example the value of a cell. e.g.
your_str = activecell.value

But if you're happy with worksheet function you may use the following
formula in a helper column. E.g. lets say your data is in column A
enter the following in B1:
=LEFT(A1,FIND(" ",A1)-1)
and copy down


--
Regards
Frank Kabel
Frankfurt, Germany

JayCeeJay wrote:
your_str represents what? The range of cells that contain the run-on
text?? I'm confused about how toopen the vba window and where to
insert the code.




All times are GMT +1. The time now is 09:50 PM.

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