+ Reply to Thread
Results 1 to 8 of 8

Triggering Alerts based on Cell Values

  1. #1
    Registered User
    Join Date
    01-17-2011
    Location
    Kent
    MS-Off Ver
    Excel 2007
    Posts
    34

    Triggering Alerts based on Cell Values

    Hello,

    i need an alert that triggers if the the following criteria is met:

    IF the value in Cell A1 is not found in a list (e.g. Cells C1:C15) and Cell B1 = 'Mover' or 'Leaver' Then Alert ("The user is not currently on the List of Active Users. Please ensure the name is correct, and that it is spelt correctly')

    I have only used Macros that trigger from buttons, so am unsure how to go about this.

    Thanks,

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Triggering Alerts based on Cell Values

    Try this in the sheet module for the sheet you need to control.
    Please Login or Register  to view this content.
    To find the correct Sheet Module
    1/. In Excel right click on the tab of the sheet you want to use the macro in.
    Select View code this will open the VBa editor with the sheet module.

    2/. Paste all of the given code in the resultant pane/window.

    3/. Save the file and close the VBa editor

    Enter a name in A1 and select from the drop-down in B2 to see the result.

    Hope this helps
    Attached Files Attached Files
    Last edited by Marcol; 02-22-2011 at 10:30 AM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Triggering Alerts based on Cell Values

    You could use Conditional Formatting to change the cell colour if the criteria aren't met.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Triggering Alerts based on Cell Values

    Taking Roys' suggestion on board, one way might be

    Conditional Formatting > Use a formula to determine whch cells to format
    Format values where this formula is true
    Please Login or Register  to view this content.
    Applies to
    Please Login or Register  to view this content.
    Format.....
    Fill > Red

    I have added this to the sample workbook below. (It still has the macro solution in it.)
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-17-2011
    Location
    Kent
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Triggering Alerts based on Cell Values

    Hi Marcol.

    i'm trying to stay away from conditional formatting, as not everyoone using this spreadsheet will have 07, and i already have a lot of conditional formatting in place!

    i've had to jiggle with your code a bit, but i'm now getting a syntax onf the first line?

    Please Login or Register  to view this content.
    Last edited by AppSupportKarl; 02-25-2011 at 08:37 AM.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Triggering Alerts based on Cell Values

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Triggering Alerts based on Cell Values

    Where do you have the macro? It should be in the sheet module.
    I don't understand why that line should throw an error, it's autumatic VBa syntax .

    This line however will not work
    Please Login or Register  to view this content.
    You haven't set a with block or defined a range to search
    the line should be like this
    Please Login or Register  to view this content.
    or safer to tighten the search criteria
    Please Login or Register  to view this content.
    Change "C:C" to suit the range you need to search, and "C1" to your start cell.

    Post a sample of the sheet you are using and I'll fix it for you.

  8. #8
    Registered User
    Join Date
    01-17-2011
    Location
    Kent
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Triggering Alerts based on Cell Values

    Thanks for your help Marcol,

    i''m still struggling, and the file is rather large... detailing around 500 staff members, and all starters, leavers or movers.

    I'll create a test environment, and post asap.

    here you go, this is a stripped down version of the workbook i'm using. the sheet in question is 'Maintenance' and although i've not amended the code, the list of names is on 'sheet1'
    Attached Files Attached Files
    Last edited by AppSupportKarl; 02-25-2011 at 12:09 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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