rickygzz,
Barbara Excel does bring up a method that will split the text strings into several different columns. However, because the text strings don't follow a set pattern and have differing amounts of words, the email addresses will end up in different columns. Also without something reliable for the =MID() formula to look for other than the @ symbol, I turned to creating a macro to extract the email addresses quickly and easily.
Attached is a sample workbook that contains a button named "Get Emails" which is assigned to the following macro:
Sub GetEmailMacro_for_rickygzz()
Const TextCol As String = "A"
Const StartRow As Long = 2
Dim Entries() As Variant, TextParts() As String, Emails() As String
Dim EntryIndex As Long, PartIndex As Long, EmailIndex As Long
Range(TextCol & StartRow).Offset(0, 1).Resize(Rows.Count - 100, 1).ClearContents
Entries = Range(TextCol & StartRow, Cells(Rows.Count, TextCol).End(xlUp)).Value
For EntryIndex = 1 To UBound(Entries, 1)
TextParts = Split(Entries(EntryIndex, 1), " ")
For PartIndex = 0 To UBound(TextParts)
If InStr(TextParts(PartIndex), "@") > 0 Then
EmailIndex = EmailIndex + 1
ReDim Preserve Emails(1 To EmailIndex)
Emails(EmailIndex) = Trim(TextParts(PartIndex))
Exit For
End If
Next PartIndex
Next EntryIndex
Range(TextCol & StartRow).Offset(0, 1).Resize(UBound(Emails), 1).Value = WorksheetFunction.Transpose(Emails)
End Sub
Hope that helps,
~tigeravatar
EDIT: We posted at the same time, rickygzz
Bookmarks