+ Reply to Thread
Results 1 to 5 of 5

Need a Macro to send email from excel through Outlook basis of different conditions

  1. #1
    Forum Contributor
    Join Date
    08-12-2013
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    147

    Need a Macro to send email from excel through Outlook basis of different conditions

    Hello Guys,

    I need help in creating a macro to send email from excel through Outlook basis of different conditions and with embedded text and subject.

    There 2 workbooks attached with this post. The workbook named “Data” contains the data and the workbook named “Emails” contains the Dealer Names (in Column A), the Email ids of the contact person (Column B, C and D), the subject (in Column E) and mail content (in Column F).

    I need a Macro which first split the data basis of “Dealer Name” Column F into multiple sheets from “Data” sheet. Now, each sheet will contain only the Individual dealer’s data. The data whose ageing is 2 or more than 2 days (in Column H) is highlighted in yellow.

    Now, I need to send a separate email to dealers with their data details from range A to F (including headers) as an embedded text with subject and mail content which is present in “Emails” workbook.

    Now the twist is, if any dealer having the Ageing value in Column H is 2 or more than 2 days (highlighted in yellow color) than the email should be sent in CC to Column D email ids but if there is no Ageing more than 2 days than the email should be sent in CC to Column C email ids.

    “To” email ids (in Column B), subject (in Column E) and mail body (in Column F) will remain same in both conditions. Column A is containing the Dealer Names through which macro will identify the email ids.

    If you need any more clarification than please let me know.

    Any help will be appreciated.

    Thanks,
    MG
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    02-20-2014
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: Need a Macro to send email from excel through Outlook basis of different conditions

    Check out Ron DeBruin's site - loads of great code on there for e-mailing through Excel

    http://www.rondebruin.nl/win/s1/outlook/mail.htm

  3. #3
    Forum Contributor
    Join Date
    08-12-2013
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    147

    Re: Need a Macro to send email from excel through Outlook basis of different conditions

    Hello estratosphere,

    Thanks for reply.

    I had checked the link. There are good macros available.

    Perhaps, the problem is there is no code available which check the values of Column H of every sheet before sending (whether it is greater then 2 or not) the email and decide the CC email ids.

    If ageing of case is older then 2 days than Macro should pick the CC email id's from Column D else the CC email id's will be pick from Column C.

    Please let me know if you something on this also.

    Thanks,
    MG

  4. #4
    Registered User
    Join Date
    02-20-2014
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: Need a Macro to send email from excel through Outlook basis of different conditions

    A simple If..Then..Else statement should be able to do that for you.

    Please Login or Register  to view this content.
    Something along those lines - with your cell references etc in it

  5. #5
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Need a Macro to send email from excel through Outlook basis of different conditions

    Try this

    Data(1).xlsm

    with this macro (I've already put the macro in for you)

    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)

Similar Threads

  1. convert excel sheet to pdf using macro and send that pdf via email using outlook
    By suresh mongam in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-25-2015, 08:51 AM
  2. Macro to send notification from excel to my Outlook Email
    By savethisid in forum Excel General
    Replies: 18
    Last Post: 03-27-2014, 02:25 PM
  3. Email Macro o send Outlook Email
    By asivaprakash in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2013, 07:05 PM
  4. Replies: 1
    Last Post: 10-03-2012, 07:31 AM
  5. Macro to send email in outlook
    By uncleslinky in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-10-2012, 10:36 AM

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