Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
=IF(ISERROR(FIND(" ",Sheet1!A2)),Sheet1!A2,LEFT(Sheet1!A2,FIND("
",Sheet1!A2)-1)) Regards Trevor "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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
paste row into Sheet2 in next row | Excel Discussion (Misc queries) | |||
copy data from sheet2 to sheet1 when sheet2 has variable # of rows | Excel Discussion (Misc queries) | |||
macro to print sheet2 without open sheet2 | Excel Discussion (Misc queries) | |||
how do copy "sheet1!A1+1 in sheet2 to sheet 3 and get "sheet2!A1+ | Excel Discussion (Misc queries) | |||
How to reference C5, D5, E5 from sheet2 in A1, A2, A3 of sheet1? | Excel Worksheet Functions |