|  

» Extract the first word in a cell in Microsoft Excel


Enter the following text in cell A1:	 	Are you going to Disneyland? 

Use the following function:
	
		=IF(ISERR(FIND(" ",A1)),A1,LEFT(A1,FIND(" ",A1)-1)) 
The result: Are


Rate This Tip
12 34 5
Rating: 4.06     Views: 109952
Extract the first word in a cell in VBA
mr t berkeley  Posted on: 31-12-1969
I am trying to write a function to remove the first part of a string of words (i.e "who,what,when,where") but with no luck.

I can use the formula :-

=IF(ISERR(FIND(",",A1)),A1,LEFT(A1,FIND(",",A1)-1))

,in a cell but need to write a function in the VB editor to do the same thing!

Does anyone have any ideas?

Regards
Name
Comment Title
Comments