View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default How to extract anitials from an email adresse?

Hi,

When you say 'initials' I assume you mean the bit to the left of the @
If so try this.

Alt+F11 to open VB editor
Right click 'This Workbook' and paste the code below in on the right
call with

=GetName(A1) where A1 contains an Email address

Function GetName(HyperlinkCell As Range)
GetName = Replace(HyperlinkCell.Hyperlinks(1).Address, "mailto:", "")
GetName = Left(GetName, InStr(GetName, "@") - 1)
End Function

Mike

"Tippo22" wrote:

Hi,

i need some help extracting initials from email adresses. All adresses have
the same domain name @qwertyui.dk but they have different lengths of initals,
e.g. aa or aab or aabb, but no more than 4 characters.

Hope you can help

Martin.