+ Reply to Thread
Results 1 to 17 of 17

Macro To Send Emails with PDF: Multiple Emails and PDF's

  1. #1
    Registered User
    Join Date
    03-18-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Macro To Send Emails with PDF: Multiple Emails and PDF's

    Hi Everyone!

    I need help creating a macro that will Email PDF's to multiple people with the PDF
    file that corresponds to them.

    I have 3 columns in Excel 2010: Column A has stores( 10 stores), Column B has store manager(10 managers), Column C has Owner of stores(3 different owners of the 10 stores).

    I would like to execute a macro that email through Outlook the 10 different managers with their PDF
    that corresponds to them. The PDF's are already created and located in a folder.

    I appreciate you help!

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Macro To Send Emails with PDF: Multiple Emails and PDF's

    this might help. call this sub with the ToNAme (managers name), SendFile (PDF File Name)

    Please Login or Register  to view this content.
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Registered User
    Join Date
    03-18-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Macro To Send Emails with PDF: Multiple Emails and PDF's

    Thank you for the quick reply. Is there a way to loop through each manager instead of typing their
    names? Perhaps adding a range?

  4. #4
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Macro To Send Emails with PDF: Multiple Emails and PDF's

    well, without seeing your code here is the basic idea...you'll have to set LastRow....I can show you how if you need that....

    Please Login or Register  to view this content.
    untested

  5. #5
    Registered User
    Join Date
    03-18-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Macro To Send Emails with PDF: Multiple Emails and PDF's

    Thank you. If you don't mind showing me. I will be using your macro. Where should I insert the last vba you entered?

    Thank you

  6. #6
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Macro To Send Emails with PDF: Multiple Emails and PDF's

    Try this. It will send emails to every address contained in column B (to the last row). As well as column C (if you need)
    Please Login or Register  to view this content.
    Last edited by Jim885; 03-18-2014 at 05:22 PM.
    If I helped in any way, please click the star

  7. #7
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Macro To Send Emails with PDF: Multiple Emails and PDF's

    where you insert this code into your macro is hard for me to say with seeing your code....I would assume it's pretty much the last thing you'll do in the macro

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-18-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Macro To Send Emails with PDF: Multiple Emails and PDF's

    Thank you judgeh59

  9. #9
    Registered User
    Join Date
    03-18-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Macro To Send Emails with PDF: Multiple Emails and PDF's

    Jim 885,

    The macro works great. Only one more request please.

    I have a 4th column which is the name of the file for that manager. Can I send the file in the directory
    that corresponds the file name in column 4?
    (Ex.) The email will send to Column B(Manager), CC Column C(Owner),use the name in Column D(ABCDE.xlsx) to find the file in the directory folder("C:\Users\"). Send

  10. #10
    Registered User
    Join Date
    03-18-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Macro To Send Emails with PDF: Multiple Emails and PDF's

    I'm VERY close to completing the macro. The only issue is column "D" which contains the file
    path is not iterating to the next cell below like column "B" and "C". Meaning the file attached to the e-mail
    is not finding the next manager and its staying on the first cell.
    Please help



    Please Login or Register  to view this content.

  11. #11
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Macro To Send Emails with PDF: Multiple Emails and PDF's

    I'm a little confused --- you say Column "D" isn't incrementing but you are looking in Column J (10) for the attachment....so StrAttachment = ...cells(i,10).value...when I step through your code with some dummy data it seems to do what I would expect...

    now the .Attachments.Add .... is not using strAttachment at all which could be an issue...

  12. #12
    Registered User
    Join Date
    03-18-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Macro To Send Emails with PDF: Multiple Emails and PDF's

    Sorry. I was trying to keep the question basic. I should have used my actual info.

    The actual columns on my excel sheet are: Column G(Is an ID), Column H(Manager email),Column I(Owner email), Column J(folder path for file-C:\Users\ABCDE.pdf)

    Thank you

  13. #13
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Macro To Send Emails with PDF: Multiple Emails and PDF's

    excellent --- so the

    .Attachment.Add still doesn't use the strAttachment variable and therefore is probably not picking up the change when "i" is incremented....

    Please Login or Register  to view this content.
    this is untested

  14. #14
    Registered User
    Join Date
    03-18-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Macro To Send Emails with PDF: Multiple Emails and PDF's

    Works great! Thanks for everyone's help!

  15. #15
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Macro To Send Emails with PDF: Multiple Emails and PDF's

    Please remember to set the thread to Solved...If you feel we deserve an increase in our reputation, feel free to click on the star in the lower left of the thread. Remember, someday when you help somebody they may add to your rep points, and it could be one of us..just a thought...

  16. #16
    Forum Contributor
    Join Date
    02-24-2013
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Macro To Send Emails with PDF: Multiple Emails and PDF's

    The code I gave you provides a way to make each of the emails personalized to an intended recipient with the highlighted part of this line;
    Please Login or Register  to view this content.

    I'm going to assume that you have the recipient’s name (or company name) (not email address) in column A so that the code works as intended.
    Otherwise you can change the '(i, 1)' to whatever column the recipient’s name is in. Whereas, 1 = column A, 2 = column B, 6 = column F ... you get the idea (number = column)

    It was easier working with you than with most other people. You understand more than some of the others who need step-by-step assistance.

    Glad we helped make your life easier.

    Please mark this as SOLVED if you don't need anything else.
    Thanks.
    Last edited by Jim885; 03-19-2014 at 06:15 PM.

  17. #17
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Macro To Send Emails with PDF: Multiple Emails and PDF's

    I defintely agree with Jim885

+ 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. VBA to send multiple emails does not complete
    By gillyr7 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-23-2014, 10:01 AM
  2. Problem using a macro to send multiple emails with separate attachments
    By joshthorntonwhite in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2013, 07:31 AM
  3. existing macro to send emails to multiple recipents needs fix
    By kiranpat in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-17-2013, 12:17 AM
  4. Send outlook emails with message in cells to individual emails associated with them
    By abinayan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-21-2011, 06:11 AM
  5. Sending macro emails using excel: Send emails with their passwords.
    By loveisblind in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2009, 03:16 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