+ Reply to Thread
Results 1 to 4 of 4

Excel Macro to Clear Data Based on Email Addresses

  1. #1
    Registered User
    Join Date
    04-18-2017
    Location
    England
    MS-Off Ver
    2013
    Posts
    25

    Excel Macro to Clear Data Based on Email Addresses

    I need an excel macro that helps me to clear the data I receive. There is a tool called Hunter.io that extracts up to 30 email addresses per desired site. I want however only 1 per site and they must be sorted.

    Here are the columns I receive:
    email address, domain name, organization, confidence score, type, sources, pattern, first name, last name, position, twitter, linkedin, phone number

    Based on the following logic order I want to sort out records:
    - there is a blacklist worksheet with 2 columns: domain, email
    - remove every row from the list of data where the domain name is present on the blacklist
    - remove every row from the list of data where the email address is present on the blacklist
    - each domain's records (up to 30 records per site) are grouped together
    - check field: position - if it contains the word:
    = editor - in this case select this value and leave the rest
    ==> in case of editor check if there are multiple, if only one, return that value
    ==> if there are multiple editor's check if there are any other words besides the editor in the value (like check length). If there are other words, see if there are no simple editor's present. If editor is present, chose the first simple editor and return.
    If only non-simple editor's are present, take the first and return.

    If there are no EDITOR present, check the next word:
    = journalist - in case if no editor but there is a journalist, check if it has any extra title. If no, return the first. If there are only special editors, return the first.

    Use the same strategy with these words in order of importance:
    reporter, writer, publisher, reviewer, contributor, Assistant, manager, public relations

    - if it has an empty position field or something unidentified (random position like marketing coordinator), then check the type column.
    = If it has both generic and personal, then remove the generic rows. Check if there are rows with first name. If there are, return first of them. If there are not, return the first row without first name.

    = If it has only generic types, we have to then check the email address.
    1. If the email address contains the following words, then we prioritize that and immediately return. They are in order of importance:
    admin, sales, info, help, contact, support, information, moderator, moderators, webmaster, press, editorial, pr, journalist, editor, news, staff, content

    2. If the email contains one of these, then we want to evade them. Only chose one of these emails, if there is no other emails. In order of importance:
    marketing, pictures, advertising, orders, techsupport, legal, work, invitations, feedback, jobs, service, events, charts, credit, donate, radio, copyright, buzz, seo, xxx, api-support, api, local, null, shop, dev, privacy, bizdev

    By following the sequence above, finally we have the most editors > journalists > ... > random personal > best generic emails per domain.

    There must be exactly that many rows how many were the unique domains in the domain column.
    Please find attached the sample data.
    Looking forward to urgent favorable response please. Thank you!
    Attached Files Attached Files

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,229

    Re: Excel Macro to Clear Data Based on Email Addresses

    Hi vbaxcel

    I would suggest uploading a sample file with a before and after scenario depicting your required result so that we can fully understand your need.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    04-18-2017
    Location
    England
    MS-Off Ver
    2013
    Posts
    25

    Re: Excel Macro to Clear Data Based on Email Addresses

    The file I shared is the sample raw file before scenario. This is all I have as of now.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,229

    Re: Excel Macro to Clear Data Based on Email Addresses

    So....take a few lines and mock up the results manually.....

+ 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. Replies: 3
    Last Post: 12-17-2015, 04:23 PM
  2. [SOLVED] Macro to open Outlook and send one email to multiple addresses from excel columns
    By telcocook in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-22-2015, 10:11 AM
  3. Replies: 0
    Last Post: 04-03-2014, 04:45 AM
  4. [SOLVED] Excel Macro lotus notes email clear attached sheet
    By johnny_w in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-02-2013, 08:24 AM
  5. Replies: 1
    Last Post: 06-21-2013, 04:05 AM
  6. Clear Up email addresses
    By aaboss in forum Excel General
    Replies: 1
    Last Post: 09-29-2011, 10:48 AM
  7. email excel file or worksheet as an attachment to multiple email addresses
    By jgeagle5 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-16-2009, 03:40 PM

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