+ Reply to Thread
Results 1 to 6 of 6

have macro to send e-mail to list of recipients, Need duplicate recipients aggregated.

  1. #1
    Registered User
    Join Date
    07-23-2020
    Location
    US
    MS-Off Ver
    365
    Posts
    3

    Thumbs up have macro to send e-mail to list of recipients, Need duplicate recipients aggregated.

    Hi all,

    To Expand: The worksheet has 7 columns (File Name, Attachment, To, Subject, Body, CC, BCC). Each row has a recipient. Each recipient receives unique order information in the body of the e-mail. The macro will then send this information in an e-mail to each recipient.

    Problem: Often, a recipient needs information for multiple orders. Using this macro, if a customer has 5 orders, they will appear on this list 5 times (the source of this data cannot be changed, each order instance will always appear on a new line). I am trying to modify the code (credits: found on ExcelTip) so this recipient, and any others that appear more than once on this list of data, will receive one e-mail with all their order information if there are multiples, instead of the reinforcement receiving multiple e-mails per order. (e.g.: Using previous example: recipient 1 will receive information for their 5 orders in one e-mail instead 5. recipient 2 will receive their 1 order. recipient 3 will receive their 2 orders. and so on.

    Below is the code. I am currently trying to enter a Do Until-Loop (until the recipient doesn't match) and then move on but I don't think I'm doing it correctly. Thank you.

    Please Login or Register  to view this content.
    Last edited by macrolearning1; 07-24-2020 at 08:50 AM.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,010

    Re: have macro to send e-mail to list of recipients, Need duplicate recipients aggregated.

    .
    Please post your workbook.

  3. #3
    Registered User
    Join Date
    07-23-2020
    Location
    US
    MS-Off Ver
    365
    Posts
    3

    Re: have macro to send e-mail to list of recipients, Need duplicate recipients aggregated.

    Quote Originally Posted by Logit View Post
    .
    Please post your workbook.

    Here it is. If the Do Until Loop that I added is removed, it will work. Though, the recipients "smith" and "doe" will receive 2 e-mails each (1 email per order). I added the Do Until Loop in an attempt to have the macro run down the list, as it does now, but send one to email to both "smith" and "does" with each e-mail containing all their orders instead. File Name/Attachment/BCC can be ignored.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: have macro to send e-mail to list of recipients, Need duplicate recipients aggregated.

    Here is a hopefully working model for you. Let me know if you have any questions. I edited this to include new functionality. Mainly, to give you the option to include multiple attachments in a single email. Your worksheet apparently has a spot for attachments, so I solved that concern with this iteration.

    lp.png

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by maniacb; 07-23-2020 at 11:22 PM. Reason: Corrections to response

  5. #5
    Registered User
    Join Date
    07-23-2020
    Location
    US
    MS-Off Ver
    365
    Posts
    3

    Re: have macro to send e-mail to list of recipients, Need duplicate recipients aggregated.

    Quote Originally Posted by maniacb View Post
    Here is a hopefully working model for you. Let me know if you have any questions. I edited this to include new functionality. Mainly, to give you the option to include multiple attachments in a single email. Your worksheet apparently has a spot for attachments, so I solved that concern with this iteration.
    Wow! Via the autofilter. That's clever as hell! Thank you!

  6. #6
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: have macro to send e-mail to list of recipients, Need duplicate recipients aggregated.

    If that takes care of your original question, please select*Thread Tools*from the menu link above and mark this thread as SOLVED.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. [SOLVED] Send mail to various recipients with only certain sheets as attachment.
    By ANDREAAS in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-08-2019, 06:48 AM
  2. VBA macro to send emails to list of recipients.
    By GNTS in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-25-2017, 10:06 PM
  3. macro to send different sheets to different recipients as per list
    By rajeshturaha in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-28-2015, 12:37 AM
  4. Mail merge - edit recipients list using macro
    By PAUL41EXCEL in forum Word Programming / VBA / Macros
    Replies: 3
    Last Post: 08-09-2015, 09:52 AM
  5. [SOLVED] VBA Send Email and Files to Recipients On List
    By hobbiton73 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-18-2014, 03:40 AM
  6. [SOLVED] How to send Lotus email with VBA to more recipients and also to more copy recipients
    By Sachy in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 03-20-2013, 03:23 PM
  7. Word 2007 Mail Merge allows to send one message to multi recipients
    By wowow in forum Word Programming / VBA / Macros
    Replies: 3
    Last Post: 12-22-2011, 08:22 AM

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