+ Reply to Thread
Results 1 to 9 of 9

extract Employee ID by matching name and email address

  1. #1
    Registered User
    Join Date
    05-20-2015
    Location
    Brampton, Canada
    MS-Off Ver
    2010
    Posts
    5

    extract Employee ID by matching name and email address

    Hello ALL,

    I have two sheets-Sheet1 has Last name,First name in one column and email address in one column.
    Sheet2 also has Last name, First name in one column, email address in one column and Employee id in another.

    I want a macro to match names from sheet 1 with two columns - Last name, First name and also email address if both match than i wanted to extract Employee id and write adjacent to that name on Sheet 1

    Thanks
    Puneet
    Last edited by PSoni; 08-25-2015 at 07:56 PM.

  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 Employee ID by matching name and email address

    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 use the paperclip icon to open the upload window.

    View Pic
    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
    05-20-2015
    Location
    Brampton, Canada
    MS-Off Ver
    2010
    Posts
    5

    Re: extract Employee ID by matching name and email address

    Sheet 1
    Employee_ID Employee Name EMP_Email
    Tatiana Ilescu [email protected]
    Virginie Cote [email protected]
    VIVIAN GARCIA [email protected]
    Vanessa Thermogene [email protected]
    Sheet 2

    EMP_ID EMP_NAME EMP_Email
    3156890 Tatiana Ilescu [email protected]
    4151000 Virginie Cote [email protected]
    3130190 VIVIAN GARCIA [email protected]
    3174200 Vanessa Thermogene [email protected]

    Both emp_name and Emp_email has to match in order to fill Emp_ID in sheet 1.

    Thanks
    Puneet
    Last edited by PSoni; 08-25-2015 at 08:08 PM.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: extract Employee ID by matching name and email address

    Maybe something like this.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-20-2015
    Location
    Brampton, Canada
    MS-Off Ver
    2010
    Posts
    5

    Re: extract Employee ID by matching name and email address

    Why there are two Next statements, also there is no End if. This macro is not working

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: extract Employee ID by matching name and email address

    1.Why should there be an End If if there's no If ?????
    2.There are 2 Next statements because there are 2 For statements.
    3.Learn the VBA basics before making any unfounded comments.
    4.The macro isn't working for you because it's based on an example file I myself created because you failed to provide one yourself, a request already made by xladept a few posts ago !!!

  7. #7
    Registered User
    Join Date
    05-20-2015
    Location
    Brampton, Canada
    MS-Off Ver
    2010
    Posts
    5

    Re: extract Employee ID by matching name and email address

    sorry i was not trying to be rude may be my wording was not right. wanted to understand the code. and yes i am a nubie and do not have much experience in vba. The code when i use gave me error in 6th line. may be because the column's are different in my sheet.

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: extract Employee ID by matching name and email address

    That's why we ask to provide an example file which reflects the true situation of your workbook so we can see how to proceed.

  9. #9
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: extract Employee ID by matching name and email address

    Considering in most cases you only have one email per employee can't you just use formulas in column A of Sheet1 based on the email to do the job like so:

    =INDEX(Sheet2!A:A,MATCH(C2,Sheet2!C:C,0))
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

+ 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 email address from eml files
    By lovinguy in forum Outlook Formatting & Functions
    Replies: 5
    Last Post: 02-08-2024, 05:31 AM
  2. [SOLVED] Extract Senders Email Address
    By Rustyroof in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-21-2015, 08:36 AM
  3. Replies: 0
    Last Post: 04-14-2015, 05:44 PM
  4. Extract email address
    By winmaxservices1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-08-2015, 02:26 PM
  5. [SOLVED] extract email address
    By anilg0001 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-18-2013, 12:05 AM
  6. Extract a domain name from an email address
    By kpratico in forum Excel General
    Replies: 4
    Last Post: 01-01-2013, 08:43 PM
  7. How to extract email address and place into a new column
    By Inquirer in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-06-2006, 04:50 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