View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Extract parts of a cell

On Mon, 21 May 2007 13:21:01 -0700, Aggies
wrote:

I have found several discussions on how to extract a first or last name, yet
I still need help on how to insert additional symbols as well...

I have in Cell A1: Mr. John Smith

I need in Cell B5: Mr. Smith:
and even, if I could get.... Dear Mr. Smith:

Can anyone offer some assistance? Thank you for your time.


You can use Regular Expressions.

Although it can be implemented in VBA, it may be easier to download and install
Longre's free morefunc.xll add-in from http://xcell05.free.fr

Then use this formula:

=REGEX.SUBSTITUTE(A1,"(.*?\.).*?(\w+)$","Dear [1] [2]:")


--ron