Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Split first name and Surname
Dear All
I have a column of text made up of surname middle initial,Firstname (i.e Bloggs A,Fred) What I am trying to do is to take the first name and use it in an email function I have created. So I need VB to extract the first name. Can anyone help Regards Newman |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Split first name and Surname
try this, if the name is in cell A1
=RIGHT(A1,LEN(A1)-FIND(",",A1,1)) -- Gary "Newman Emanouel" wrote in message ... Dear All I have a column of text made up of surname middle initial,Firstname (i.e Bloggs A,Fred) What I am trying to do is to take the first name and use it in an email function I have created. So I need VB to extract the first name. Can anyone help Regards Newman |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Split first name and Surname
VB you say?:
firstName = Split(Selection, ",")(1) will work if there's only one comma in the string. And if there are errant spaces after the comma or after the end of the first name then a refinement: firstName = WorksheetFunction.Trim(Split(Selection, ",")(1)) will get rid of them. -- p45cal "Gary Keramidas" wrote: try this, if the name is in cell A1 =RIGHT(A1,LEN(A1)-FIND(",",A1,1)) -- Gary "Newman Emanouel" wrote in message ... Dear All I have a column of text made up of surname middle initial,Firstname (i.e Bloggs A,Fred) What I am trying to do is to take the first name and use it in an email function I have created. So I need VB to extract the first name. Can anyone help Regards Newman |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sorting by surname when first name and surname are in the same cel | New Users to Excel | |||
Split surname from end of name data | Excel Worksheet Functions | |||
Change around surname and name | Excel Discussion (Misc queries) | |||
Display only surname | Excel Worksheet Functions | |||
Name Surname combination | Excel Programming |