+ Reply to Thread
Results 1 to 5 of 5

Macro Code to send email

  1. #1
    Registered User
    Join Date
    02-19-2013
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    Macro Code to send email

    I have been reading a lot of different codes that come very close to what I need but not exactly. I have data on sheet 1 that is then copied to sheet 2 with calculating formula to total. If this is over my limit criteria then an email must be sent to the customer. The way I do this now is I open outlook 2010 and input all the email address's in BCC and the body of the email is copied from a excel worksheet. What I would like to create is a macro that will take a yes or no in a column beside the email address copy the body from the sheet that contains that info and send to that email. I appreciate any help on could offer.
    Thanks

  2. #2
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Macro Code to send email

    if you search you can find plenty of code for email...try to incorporate this piece of code into yours and see if it helps you.
    (in col C type yes or no, if you type "yes" the code displays/sends the email)
    Please Login or Register  to view this content.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  3. #3
    Registered User
    Join Date
    02-19-2013
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro Code to send email

    Thanks John,
    I will have ago with this and see how it works out.

  4. #4
    Registered User
    Join Date
    02-19-2013
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro Code to send email

    I have edited the code to send the "to" as Bcc this works, however, I have two email address's attached to my outlook program. The first in the "From:" category has a signature attached for every email sent and the second is from another email address and has no signature. This is the one I want to use. I tried to insert the "from:" category just ahead of the "to:" but this gave me a syntax error I changed things again and then I got an expression error so I removed it from the code. I also I'm not sure how to call another tab up with all it's contents in the same work book and insert that as the "body" of the email as this will always be the same.
    Hope this make sense.

  5. #5
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Macro Code to send email

    as far as I know "From" does not work, for add the signature please see here http://www.excelforum.com/excel-prog...-vba-code.html
    it works very well.
    also you can build your signature using html code
    Please Login or Register  to view this content.

+ 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