+ Reply to Thread
Results 1 to 4 of 4

How can I have an email automatically sent to me if two conditions occur?

  1. #1
    Registered User
    Join Date
    05-05-2016
    Location
    Ohio
    MS-Off Ver
    2010
    Posts
    4

    Question How can I have an email automatically sent to me if two conditions occur?

    I am trying to create a macro that will help notify me when a "safe launch" period has ended in our manufacturing facility. The safe launch just means we sample more during the initial roll out of new parts. To be considered safely launched, a part number must be ran for 6 months and for 10 separate orders. My spreadsheet consists of rows that are headed by the part number. The column headers are the date that the part numbers were first ran and the numbers 1-10. As an order for a specific part number is successfully ran, the operator will type an X in the next column. Once the 10th X is marked down and the initial date is 6 months old, I would like to receive an email saying that the part has met the safe launch requirements and I can cut back on the sampling plan. Right now I have the spreadsheet conditionally formatted so that if the date is 180 days ago and the 10th column has an X in it, the entire row turns green. I have tried to find examples of similar situations online but have not been successful. Does anyone know how one would go about doing this? The goal is to send an email when two conditions are met. The conditions are a date being older than 6 months and an X is typed in the 10th column. Spreadsheet attached.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: How can I have an email automatically sent to me if two conditions occur?

    You could use this code that check situaation and send email before than you close the workbook.
    The code put the word 'sent' in M column to indicate that email has been sent and it's not necessary to send another time.
    To use the code right click on the name of your worksheet in the bottom, paste the code and then click on Tools menu, choose Reference and select Microsoft Outlook xx.x Object Library.
    Please Login or Register  to view this content.
    Regards,
    Antonio

  3. #3
    Registered User
    Join Date
    05-05-2016
    Location
    Ohio
    MS-Off Ver
    2010
    Posts
    4

    Re: How can I have an email automatically sent to me if two conditions occur?

    Antonio,
    Thank you for the help. I pasted the code into the Sheet1, changed the email to mine, checked Outlook 14.0 object Library in the references, made sure to delete the apostrophe in front of .Display and tried to update a part number. I didn't see any emails pop up so I am not sure what I am doing wrong. Did you get it to work for you? Are there any restrictions I might be unaware of that would keep Outlook from opening?

    Thanks
    Last edited by ccb12; 05-06-2016 at 01:27 PM. Reason: forgot a step

  4. #4
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: How can I have an email automatically sent to me if two conditions occur?

    On my computer it works, and if you delete apostophe in front of .Display and put apostophe in front of .Send you will see the email so you can check it before to send. I'm sorry that it doesn't work in your computer... do you usually use Outlook as mail client?
    Regards,
    Antonio

+ 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. Replies: 0
    Last Post: 11-24-2015, 03:29 AM
  2. Replies: 6
    Last Post: 11-06-2014, 06:12 AM
  3. Replies: 5
    Last Post: 07-23-2014, 12:46 PM
  4. Macro doesn't automatically resolve All email address when email is drafted
    By sonny.thind in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2011, 12:58 PM
  5. Automatically Unprotect Worksheet Before Email Macro Then Protect After Email is Sent
    By geepeeone in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-23-2011, 07:45 PM
  6. Excel email with three conditions
    By CindyG in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-06-2009, 02:12 PM
  7. Return Value If Two Conditions occur
    By Hatman in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-30-2006, 04:35 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