+ Reply to Thread
Results 1 to 11 of 11

Email rows if conditions met

  1. #1
    Registered User
    Join Date
    12-14-2020
    Location
    Bahrain
    MS-Off Ver
    2010
    Posts
    14

    Email rows if conditions met

    I'm working in a vehicle workshop and I am trying to build a program that will email each service advisor via outlook, their outstanding jobs which have all parts available.
    (parts are ordered and the customer might take the car away, I want the advisors to be reminded daily so that they can get the customers back in for the parts to be fitted).

    My current sheet takes all of its information from our WIP handling system and is updated every morning automatically.

    Basically I am trying to set it so that IF date in column E is < TODAY AND Column D = All parts available AND column F = OUT THEN email the advisor in Column C all and only the rows that apply to that advisor.
    Then email the management team a summary of all jobs with parts in and vehicles out

    I have a sample code that i use on another sheet but all it does is email a link to that spreadsheet every morning, i want this one to me more targeted and actually email them rows from the spreadsheet individually.

    Is this possible?

    Many thanks.
    Attached Files Attached Files
    Last edited by adam1992; 01-12-2021 at 09:10 AM.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Email rows if conditions met

    A few questions for clarification:
    -I don't see any email addresses on your sheet. Do you want the email address to remain blank in the email?
    -How do we know who the "managements team" is?

    Post the code you are currently using. Remember to use code tags when posting the code.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

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

    Re: Email rows if conditions met

    Although @Mumps questions are relevant and answers are needed, I have made a number of assumptions to provide a possible solution. The code needs data entry in a few places, annotated by '''''''' characters. One assumption is that you can enter emails for each contact in column I as in the attached email. Also, enter the management email in cell M2.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    12-14-2020
    Location
    Bahrain
    MS-Off Ver
    2010
    Posts
    14

    Re: Email rows if conditions met

    My apologies, I have updated the example with the emails. Column I displays an email based on an IF statement and the managers emails are in cell M2.

    I have played about with your code and it seems to work well, Thank you so much.

    I have a couple of questions though,

    If I leave the email cell blank, the code stops working. Because I don't want to send an email to everyone who has parts in and only the service advisors, is it possible to adapt the code to pass if it see's a blank cell?

    Is it possible to have the email sent automatically i.e, I'd like to send an update to the service advisors (all emails in column I) every morning but only send to the Management team on a Sunday morning (middle east so sunday is the first working day of the week).

    I would also like to send a full breakdown of spreadsheet to the commercial vehicle dept.
    Is it possible to do something like, IF B2 = "C" THEN email all lines that apply rather than just "all parts available"

    Thank you
    Attached Files Attached Files
    Last edited by adam1992; 01-09-2021 at 04:07 AM.

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

    Re: Email rows if conditions met

    The code has been updated to deal with Blank email lines. I also added a button to execute the email summary to management. Reviewing your other requests.

    For
    I would also like to send a full breakdown of spreadsheet to the commercial vehicle dept.
    Do you want a button to send the table contents only when Column B contains a C?
    Attached Files Attached Files
    Last edited by maniacb; 01-09-2021 at 02:29 PM.

  6. #6
    Registered User
    Join Date
    12-14-2020
    Location
    Bahrain
    MS-Off Ver
    2010
    Posts
    14

    Re: Email rows if conditions met

    That's fantastic, thank you

    There's one issue though, when you click 'send email' it filters them correctly but wants to send each email to 'grthomas'
    The managers button though, works perfectly

    Yes, a button that basically filters column B to show only 'C' and then email the full sheet regardless of parts delivered or OUT etc.

    Sorry if I am being a pest, I am very new to using this function

  7. #7
    Registered User
    Join Date
    12-14-2020
    Location
    Bahrain
    MS-Off Ver
    2010
    Posts
    14

    Re: Email rows if conditions met

    Got the commercial vehicle bit working now, I just added another button and copied your code into another macro with different filters.

    Only issue remaining is the advisors button sending all the emails to the same person

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

    Re: Email rows if conditions met

    Repaired the first two modules.

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    12-14-2020
    Location
    Bahrain
    MS-Off Ver
    2010
    Posts
    14

    Re: Email rows if conditions met

    Thank you,
    Now the grthomas and sajeesh.s emails are working fine, but the next one tries to send the sheet for jaffar.taher to hamza and the remaining sheets don't have a recipient

    I tried changing the range from "BB" to "I" but it tried to send 300 seperate emails

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

    Re: Email rows if conditions met

    my bad, I was overthinking the process. This correction should resolve the issue;

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    12-14-2020
    Location
    Bahrain
    MS-Off Ver
    2010
    Posts
    14

    Re: Email rows if conditions met

    Perfect now, thank you for your help

+ 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] Email range macro shows hidden rows in the email
    By jennis7242 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2019, 11:04 AM
  2. [SOLVED] Help combining macros to delete rows on conditions and add data into cells on conditions
    By JayJayGC in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-03-2017, 10:14 AM
  3. email notification by excel with some specified conditions
    By kumaraguru in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-19-2016, 11:46 PM
  4. Email Reminder for Highlighted Rows & Email Addresses
    By xerksis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-07-2015, 02:46 AM
  5. [SOLVED] Re: Loop through the rows and extract unique email id's to generate email drafts
    By spiwere in forum Excel Programming / VBA / Macros
    Replies: 28
    Last Post: 01-28-2014, 04:12 AM
  6. email if conditions are meet
    By keithnrhonda in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2014, 01:13 AM
  7. Excel email with three conditions
    By CindyG in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-06-2009, 02:12 PM

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