View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Extracting First Name from cell with first name and last name

Whoops! You wanted this in VB code, right? Sorry, try this...

FirstName = Split(Range("B10").Value)(0)

--
Rick (MVP - Excel)



"Rick Rothstein" wrote in message
...
You probably want this...

=LEFT(A1,FIND(" ",A1&" ")-1)

but be advised that it (and most other solutions) will return the wrong
result for people whose first name has a space in it (such as Mary Ann).

--
Rick (MVP - Excel)



"Matt" wrote in message
...
I have searched several posts and am still stumped. I have a first
name and last name in Cell B10 on Sheet1. I want to extract the first
name with no spaces. It is part of a bigger code where I am opening
outlook and making an email. The end result is to use the person's
first name in the saluation. I have all the code to do everything
except that I can't figure out how to grab the first name. Any help
would be greatly appreciated. Thanks in advance.

Matt