+ Reply to Thread
Results 1 to 11 of 11

Retrieve email addresses from another worksheet

  1. #1
    Registered User
    Join Date
    02-22-2008
    Posts
    13

    Retrieve email addresses from another worksheet

    Hi everyone,

    Attached is the excel file example
    Need help in retrieving email address from Column M in "Work1" into Column E in "Sheet1" by matching the Keys in "Sheet1" against the Keys in "Column D - Work1".
    The email in the same row will be retrieved.

    There are duplications of the same Keys. E.g. 4 Donut in "Sheet1". In "Work1", there will also be the same 4 duplications of Donut.


    Example of the output in "Sheet1" (After retrieving the email addresses from Work1) will be:

    Donut [email protected]
    Donut [email protected]
    Donut [email protected]
    Donut [email protected]



    Thanks!
    Attached Files Attached Files
    Last edited by cjGod; 08-03-2011 at 05:19 AM.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Retrieve email addresses from another worksheet

    hi, cjGod, solution with VB, please check attachment, run code "test".

    Notes: As you have "Donut" on the first sheet and "Donuts" on the "Work1" sheet, the search is made by part match.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-22-2008
    Posts
    13

    Re: Retrieve email addresses from another worksheet

    Hi watersev,


    I have amended the Keys to be the same in work1 and sheet1. Please find attached.

    Thanks for macros, however it is not exactly solving. I need to check for all the Keys in sheet1 against columns D to J in Work1 and not just in column D itself.

    Also there might possibility that I will add in new Keys in sheet1 and the keys will be in new columns in work1. If it is possible to do something dynamic, that I can edit the macro VB script next time if I have new Keys added.



    Thanks!
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Retrieve email addresses from another worksheet

    Quote Originally Posted by cjGod View Post
    Need help in retrieving email address from Column M in "Work1" into Column E in "Sheet1" by matching the Keys in "Sheet1" against the Keys in "Column D - Work1".The email in the same row will be retrieved.
    ok, solution provided as per initial task. The code does exactly what was expected as per description.

    Quote Originally Posted by cjGod View Post
    Thanks for macros, however it is not exactly solving. I need to check for all the Keys in sheet1 against columns D to J in Work1
    Thanks!
    It would be correctly to say the code does exactly solving the problem set. I'm not an extrasens to guess that "matching the Keys in "Sheet1" against the Keys in "Column D - Work1" means "check for all the Keys in sheet1 against columns D to J in Work1".

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Retrieve email addresses from another worksheet

    please check attachment, run code "test". Input keys data range last column index number.

    Notes:
    1. Option Compare Text makes "A" equal to "a" so it turns off case sensitivity. If you do not need it, delete this line.
    Attached Files Attached Files
    Last edited by watersev; 07-22-2011 at 08:49 AM.

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Retrieve email addresses from another worksheet

    or
    Please Login or Register  to view this content.



  7. #7
    Registered User
    Join Date
    02-22-2008
    Posts
    13

    Re: Retrieve email addresses from another worksheet

    Quote Originally Posted by watersev View Post
    please check attachment, run code "test". Input keys data range last column index number.

    Notes:
    1. Option Compare Text makes "A" equal to "a" so it turns off case sensitivity. If you do not need it, delete this line.
    Hi watersev,

    It is working Great!. Many thanks for your help

  8. #8
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Retrieve email addresses from another worksheet

    if you are happy with the offered solution, please mark the thread as solved (see Forum rules for details)

  9. #9
    Registered User
    Join Date
    02-22-2008
    Posts
    13

    Re: Retrieve email addresses from another worksheet

    Quote Originally Posted by watersev View Post
    if you are happy with the offered solution, please mark the thread as solved (see Forum rules for details)
    Hi watersev,


    The macros in your latest workbook, actually put the email address by matching the Keys. I have another problem here which in the event in "Sheet1" the key is "hotline" and in "Work1" there is 1 key which is "hotline check", it will still put the email.
    I need the macros to match the exact Keys, example the email will be only pulled if in "Sheet1" the key is "hotline", in "Work1" the key need to be "hotline" also.



    Regards
    CJ

  10. #10
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Retrieve email addresses from another worksheet

    change this line:

    Please Login or Register  to view this content.
    to this one:

    Please Login or Register  to view this content.

  11. #11
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Retrieve email addresses from another worksheet

    please check attachment
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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