View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default User Defined Functions to separate full names

Function FirstName(FulNameCell As Range)
FirstName = Split(FulNameCell.Value, " ")(0)
End Function

Function Middleinitial(FulNameCell As Range)
Middleinitial = Split(FulNameCell.Value, " ")(1)
End Function

Function LastName(FulNameCell As Range)
LastName = Split(FulNameCell.Value, " ")(2)
End Function


--
Gary''s Student - gsnu200787


"DZ" wrote:

Hi

I want to create three user defined functions
1. FirstName
2. MiddleInitial
3. LastName

so that a user can use them by selecting the function(s) from the Paste
Function Dialog and then simply selecting a cell reference that contains the
full name.

I already know how to create the function arguments as follows

Function FirstName (FulNameCell as range)
Code----------------------
End Function

I need the complete code to get the first name etc

Also

Function Middleinitial (FulNameCell as range)
Code----------------------
End Function

Function LastName (FulNameCell as range)
Code----------------------
End Function

Thanks alot for help with this.

DZ