+ Reply to Thread
Results 1 to 7 of 7

pop up box when formula result returns a certain value

  1. #1
    Registered User
    Join Date
    03-14-2014
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003
    Posts
    4

    pop up box when formula result returns a certain value

    Hi guys,

    I'm a total novice so I apologise in advance for poor Excel lingo and the like..

    I have a spreadsheet in which column H returns a numeric value based on a simple formula (just adding and subtracting values from a couple of different cells) ie: the user does not enter values into this cell manually.

    H column values are cumulative by row based on the values entered into the corresponding cells in columns F or G.

    The value in the H column should be below 40.

    I am looking for a pop up box that is generated when the cell value is equal to or greater than 40 after an entry is made into the corresponding F or G cell.

    I did find the example below, but I don't know how to make it apply to the appropriate cell range in column H. The range I need it to look at is H9:H60. It does work if I enter a vlue of greater than 40 in cell H9.


    Please Login or Register  to view this content.


    If anyone has any suggestions I'd be most appreciative!!

    Remember, I don't know what I'm doing so please be gentle!

    Kat
    Last edited by JBeaucaire; 03-24-2014 at 02:53 AM. Reason: Added missing CODE tags, please read and follow the forum rules, link above in the menu bar. Thanks.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: pop up box when formula result returns a certain value

    This should do it:
    Please Login or Register  to view this content.

    Please take a note of the forum rules, CODE tags are required when posting VBA. Thanks.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    03-14-2014
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: pop up box when formula result returns a certain value

    Thanks Jerry,

    (thanks also for pointing out the CODE tags requirement - will make sure I do this in future)

    The code you suggested definitely works in that once the value in column H went over 40, the dialog box popped up, the only problem is that as I enter subsequent values in column F or G (irrespective of the change to the value in column H - even if it drops back below 40) the dialog box still pops up. It is obviously looking for any instance of values in column H being over 40. Is it possible for the code to only look at the final value in column H - ie: if there are values in column H between rows 9 and 15, then only check the value in row 15 and ignore instances of greater than 40 in cells 9 - 14?

    Columns F and G are both manual data entry (numeric values). A value in column F increases the value in the correspodning cell in column H, whereas a value added to column G will be substracted from column H. Essentially column H is a running tally (total range between H9 and H60).

    Thanks again for your help!

    Kat

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: pop up box when formula result returns a certain value

    Why not make it simple, then. In an empty cell, let's say Z1, put a formula that gives current value of all the data entered:

    =SUM(F:F)-SUM(G:G)
    (or whatever range you want to set)

    Then the macro need only watch the value of that one cell:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-14-2014
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: pop up box when formula result returns a certain value

    That's awesome!

    So simple I wish I'd thought of it myself! haha!!

    Thanks for your help Jerry - I really appreciate it

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: pop up box when formula result returns a certain value

    You wanna really get fancy, you don't even have to use a cell on the sheet. You can create something called a "Named Formula" that's hidden in the background and you can check it's value at any time.

    1) Press CTRL+F3 to open the Name Wizard window

    2) Enter a new name, let's call it ToilLimit (notice it's two words but no space? Spaces aren't allowed in named formulas)

    3) In the RefersTo: line enter that formula I gave you, but add $ signs:

    =SUM($F:$F)-SUM($G:$G)

    4) Now you can get the current value of ToilLimit several ways:

    - in a cell the formula would be =ToilLimit

    - Change the macro given to check that hidden value:
    Please Login or Register  to view this content.

    Anyway,
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  7. #7
    Registered User
    Join Date
    03-14-2014
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: pop up box when formula result returns a certain value

    I had no idea you could even do that!

    I think that will come in very handy not just for this issue, but for others in the future.

    Will close the thread off now - thanks heaps for your help!

    Kat

+ 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. My formula returns a result but the cell displays a zero?
    By Excel User in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-05-2017, 10:54 AM
  2. [SOLVED] formula returns wrong result
    By zplugger in forum Excel General
    Replies: 3
    Last Post: 03-12-2014, 01:17 PM
  3. [SOLVED] IF Formula that returns a numerical result
    By pembree in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-14-2013, 01:10 PM
  4. isblank & vlookup formula returns #n/a result and incorrect result
    By helpmeplease333 in forum Excel General
    Replies: 5
    Last Post: 05-06-2012, 11:41 PM
  5. IF Function returns result of formula
    By AKlein in forum Excel General
    Replies: 2
    Last Post: 03-02-2006, 12: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