+ Reply to Thread
Results 1 to 7 of 7

Extract Email Addresses

Hybrid View

  1. #1
    Registered User
    Join Date
    05-06-2013
    Location
    Springfield USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Extract Email Addresses

    I have a single cell that has names mixed with email addresses. LOTS of names and email addresses all in one cell.

    Example: A1= joesmith@yahoo.com,joe smith sally@jones.com,Sally Jones ...

    Need a column with ONLY email address for everyone in that original cell.

    Thanks for your help.
    Last edited by amicman; 05-06-2013 at 04:02 PM.

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Extract Email Addresses

    Hi,

    assumption: the mail address is separated from other text by a space " " or a comma ",": Mail.xlsm

    Regards
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  3. #3
    Registered User
    Join Date
    05-06-2013
    Location
    Springfield USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Extract Email Addresses

    Yes, Corrected Example: A1= joesmith@yahoo.com,joe smith sally@jones.com,Sally Jones ...

  4. #4
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Extract Email Addresses

    Try the example file from post #2.

    Regards

  5. #5
    Registered User
    Join Date
    05-06-2013
    Location
    Springfield USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Extract Email Addresses

    My emails are all in one cell. I tried replacing your single email+text with mine and it does not work.

  6. #6
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Extract Email Addresses

    for all in one cell (A1) try this one:
    Option Explicit
    
    Sub ExtractMail()
        Dim aData
        Dim i As Long, lngrow As Long
        
        With ActiveSheet
            aData = Split(.Cells(1, 1).Value2, ",")
            lngrow = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
            For i = LBound(aData) To UBound(aData)
                If InStr(aData(i), "@") > 0 Then
                    If InStr(aData(i), " ") > 0 Then
                        aData(i) = Right(aData(i), Len(aData(i)) - InStrRev(aData(i), " "))
                    End If
                    .Cells(lngrow, 1).Value2 = aData(i)
                    lngrow = lngrow + 1
                End If
            Next i
            
        End With
        
    End Sub

  7. #7
    Registered User
    Join Date
    05-06-2013
    Location
    Springfield USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Extract Email Addresses

    PERFECT! Thanks for your help!!!

    David

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1