View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bill Barclift Bill Barclift is offline
external usenet poster
 
Posts: 23
Default first name and a second name - In Sheet2 I only need the first name

Take a look at the Mid/Instr functions or Split function. In either case,
the first name/last name must have a delimitter to distinguish them (space,
comma, etc.). Both of the following cases assume comma delimitted.

Using Mid/Instr functions:

Mid(rng.Value, 1, InStr(sFullName, " ") - 1)

Using Split function (1st array member contains first name, 2nd array member
contains last name):

aryTemp = Split(sFullName)


Bill Barclift

"tegger" wrote in message
...
Sheet1 Range A2 contains a first name and a second name.

Sheet2 Range A2 contains =(Sheet1!A2)

In Sheet2 I only need the first name.

Can I do this with a formula?



Thanks,

DL