+ Reply to Thread
Results 1 to 5 of 5

Send email when criteria is met

  1. #1
    Registered User
    Join Date
    06-19-2014
    Location
    Peterborough, England
    MS-Off Ver
    2013
    Posts
    8

    Send email when criteria is met

    Hi there,

    This is my first post so I would like to take an opportunity and say hello to everybody.
    I'm working on one file which should send alert when criteria is met and insert chart in to the outlook body. I have the code for it but there is a problem. For example when value in cell A1 reaches let's say 70% it sends email. The problem is that when any other values are being changed it keeps sending emails even if value in cell A1 is not changing. I'm using Worksheet_calculate event for it. Also I can't figure out how to insert only the chart in the email body, currently I'm selecting the range where the chart is and doing it this way, but the chart is not looking good in the email.
    I'm attaching the sheet hopefully it will make more seance.
    Worksheet_calculate event is in sheet "Email list"
    Code for sending email is in module3

    Hope I explained this good enough.
    Thank you
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Send email when criteria is met

    Hi and welcome to the forum.

    Try something like this to trigger the emails. Each time it calculates, the calculated Max is compared to the stored max in cell G8. If it's different, the new calculated max is stored in G8 and runs your AlertS macro.

    Please Login or Register  to view this content.


    The chart looks fine to me in the email. Another method could be to store the Chart as an image and put the Chart-Image within the email. Here's a link with example code...
    Mail chart or chart sheet as picture
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    06-19-2014
    Location
    Peterborough, England
    MS-Off Ver
    2013
    Posts
    8

    Re: Send email when criteria is met

    Thanks for that, it does what I asked for, but I forgot to mention one thing, sorry for being idiot. In the "email list" sheet is 4 different values 70%, 80%, 90% and 100%. when the "MAX" reaching these numbers I need to trier alerts. so for example when it reaches 70% email will be send to one person, when it reaches 80 it will send it to different person up until 100%.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Send email when criteria is met

    Quote Originally Posted by ball32 View Post
    Thanks for that, it does what I asked for, but I forgot to mention one thing, sorry for being idiot. In the "email list" sheet is 4 different values 70%, 80%, 90% and 100%. when the "MAX" reaching these numbers I need to trier alerts. so for example when it reaches 70% email will be send to one person, when it reaches 80 it will send it to different person up until 100%.
    Your AlertS macro already distinguishes between the different MAX tiers

    This will trigger when the tier level changes, and not for a small change within the same tier. Is that what you meant?

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-19-2014
    Location
    Peterborough, England
    MS-Off Ver
    2013
    Posts
    8

    Re: Send email when criteria is met

    Thank you very much for this this is exactly what I was looking for. Perhaps you can help me with the sending chart bit as well?

+ 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. Workflow with signatures (if cell=x then send email, if signed then send email)
    By Kate2811 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-25-2014, 05:37 AM
  2. Send New Email W/ Body of Received Email, Then Delete Sent Email
    By edneal2 in forum Outlook Formatting & Functions
    Replies: 2
    Last Post: 07-01-2013, 12:45 AM
  3. Automatic send email (without even click send in mail software) with excel vba ??
    By alexnkc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-17-2013, 08:31 PM
  4. Code to send Email wont send everytime
    By tanktata in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-11-2011, 04:44 PM
  5. [SOLVED] Send Email Based on Spreadsheet Criteria
    By WDP in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-27-2005, 07:05 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