+ Reply to Thread
Results 1 to 1 of 1

Help with running a macro when certain cells change value and meet a criteria

  1. #1
    Registered User
    Join Date
    03-03-2014
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    1

    Help with running a macro when certain cells change value and meet a criteria

    The project i'm working on is a spreadsheet that I use to monitor stock levels of a product. In total there are 74 different products on the spreadsheet.

    I've got the macro working perfectly so that it will send a email to the specified location etc.

    The part i'm stuck on is getting the vba code to know when to send the email.

    What I want to happen is that whenever the volume of stock on any one of the products (L4:L78) drops bellow 500, it will run my macro email to inform the client their stock is low.

    I've managed to make this work with just one cell, but it wouldn't let me adapt it to affect all the cells.

    The cells, L4 for example is a calculated total of new stock inputs and outputs B4:K4.

    Here are some codes I have tried that couldn't make fully work.

    Please Login or Register  to view this content.
    This one worked but I couldn't make it work for more than one cell. eg. chaning [L4] to [L4:L78] made that code unusable.

    Please Login or Register  to view this content.
    Again had errors making this work.

    Any help of advice would be hugely appreciated as this is starting to be far to time consuming for someone with limited vba knowledge where I think it would be a very easy fix for the pros!

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,367

    Re: Help with running a macro when certain cells change value and meet a criteria

    First, you need some way to know when you have already sent the email, so let's say that column M of the same row is available. Further, you need to re-write you emailing macro to know which cell you have just analyzed. And even further, you need to decide when to re-contact - this will email every time the value in column L drops below 500 or further drops.

    Please Login or Register  to view this content.
    This will only contact once when the value drops below 500
    Please Login or Register  to view this content.
    This is what you need to do to start to change your mailing macro:
    Please Login or Register  to view this content.
    You also need to decide what to do when the value rises above 500 from below - both examples re-set the contact flag.
    Last edited by Bernie Deitrick; 03-03-2014 at 04:22 PM.
    Bernie Deitrick
    Excel MVP 2000-2010

+ 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. Sum cells that meet ALL criteria
    By Andrew-Mark in forum Excel General
    Replies: 5
    Last Post: 03-07-2012, 11:01 AM
  2. Cells Format change after running a macro
    By iman1300 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2010, 12:37 PM
  3. add cells that meet certain criteria
    By sayasimpson in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-19-2007, 02:15 PM
  4. Sum cells where row meet certain criteria
    By jarviscars in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-05-2007, 06:35 PM
  5. [SOLVED] macro to copy cells that meet criteria (mattour)
    By matthias in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-04-2006, 01:30 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