+ Reply to Thread
Results 1 to 9 of 9

Extract or Delete only specific email addresses from a cell (i.e., *.gmail.com)

  1. #1
    Registered User
    Join Date
    08-19-2010
    Location
    Arizona, USA
    MS-Off Ver
    Excel Mac 2011
    Posts
    59

    Extract or Delete only specific email addresses from a cell (i.e., *.gmail.com)

    I have a 3 column spreadsheet with headers that has 500 rows.
    Col C contains multiple email addresses in each cell.
    I need to remove ONLY the *@gmail.com email addresses but keep all of the others.
    Each email address is seperated by a semicolon (";").

    Example
    Col A = Company
    Col B = Status
    Col C = eMail addresss (i.e., joe.black@companyname.com; john.smith@gmail.com; jane.doe@companyname.com)

    After the code is run I would like Col C to be joe.black@companyname.com; jane.doe@companyname.com (Cols A & B remain the same).

    Any help would be greatly appreciated!

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Extract or Delete only specific email addresses from a cell (i.e., *.gmail.com)

    Try this:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    08-19-2010
    Location
    Arizona, USA
    MS-Off Ver
    Excel Mac 2011
    Posts
    59

    Re: Extract or Delete only specific email addresses from a cell (i.e., *.gmail.com)

    Thx xladept! I ran the code and it failed on the following line:
    Please Login or Register  to view this content.
    Last edited by symaxf; 11-13-2017 at 10:04 PM.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Extract or Delete only specific email addresses from a cell (i.e., *.gmail.com)

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  5. #5
    Registered User
    Join Date
    08-19-2010
    Location
    Arizona, USA
    MS-Off Ver
    Excel Mac 2011
    Posts
    59

    Re: Extract or Delete only specific email addresses from a cell (i.e., *.gmail.com)

    Sample file attached. Note: The sample contains 3 records but the actual data varies from month to month upwards of 500+ records. I would like the macro to be able to handle a variable range. Thx again!
    Last edited by symaxf; 11-13-2017 at 11:21 PM. Reason: clarity

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Extract or Delete only specific email addresses from a cell (i.e., *.gmail.com)

    Well, it didn't fail for me but this new code allows for the carriage return that I hadn't expected:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-19-2010
    Location
    Arizona, USA
    MS-Off Ver
    Excel Mac 2011
    Posts
    59

    Re: Extract or Delete only specific email addresses from a cell (i.e., *.gmail.com)

    The actual file I'm running the macro on also has the following conditions, although rare:

    -Blank spaces after a carriage return
    -Email addresses not always separated by a semicolon
    -Some cells in Col C are blank

    I'm trying to attach the actual file here but it's not letting me (via 'Go Advanced').
    Last edited by symaxf; 11-14-2017 at 05:05 AM.

  8. #8
    Registered User
    Join Date
    08-19-2010
    Location
    Arizona, USA
    MS-Off Ver
    Excel Mac 2011
    Posts
    59

    Re: Extract or Delete only specific email addresses from a cell (i.e., *.gmail.com)

    xladept, Thx again for all of your help on this and for pointing me in the right direction. This is the final code that was generated using your code as a model. Take care my friend!
    Please Login or Register  to view this content.

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Extract or Delete only specific email addresses from a cell (i.e., *.gmail.com)

    You're welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. extract several email addresses from certain cells
    By bottledwater in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-14-2016, 10:57 AM
  2. Send an ALERT email to a GMAIL address if conditions are met in a specific cell
    By zeegerman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-25-2015, 04:56 PM
  3. [SOLVED] How can I extract email addresses within text
    By sueryan13 in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 10-17-2015, 04:58 AM
  4. [SOLVED] Extract Email Addresses
    By amicman in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-06-2013, 04:33 PM
  5. email with corresponding addresses and names in body AND subject using gmail
    By excel4phil in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-22-2013, 04:09 AM
  6. Extract email addresses from hyperlinks
    By artsy in forum Excel General
    Replies: 1
    Last Post: 11-10-2011, 09:37 AM
  7. How to extract email addresses to new column
    By Inquirer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2006, 04:30 PM

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