+ Reply to Thread
Results 1 to 9 of 9

Run a message box / macros based on cell value.

  1. #1
    Registered User
    Join Date
    09-23-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    68

    Run a message box / macros based on cell value.

    Looking to either create a message box, or run a piece of macros code that contains the message box based on cell value.

    Data is in M10.

    If the number in there is 17 and below, would like to to run "UNDER" Macros (Which is a message box).

    If the number in there is 80 and over, would like to to run "OVER" Macros (Which is a message box).

    Could someone help me out?

    Thanks

  2. #2
    Forum Contributor
    Join Date
    01-31-2007
    Location
    Aschaffenburg, Germany
    MS-Off Ver
    Office 2013
    Posts
    104

    Re: Run a message box / macros based on cell value.

    That would be an Event macro in the sheet containing the subject M10 cell:
    Please Login or Register  to view this content.
    Mike 1001
    _________________________
    Let's keep trying, one day we'll succeed!

  3. #3
    Registered User
    Join Date
    09-23-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    68

    Re: Run a message box / macros based on cell value.

    Works a treat, thank you.

  4. #4
    Forum Contributor
    Join Date
    01-31-2007
    Location
    Aschaffenburg, Germany
    MS-Off Ver
    Office 2013
    Posts
    104

    Re: Run a message box / macros based on cell value.

    You're welcome!

  5. #5
    Registered User
    Join Date
    09-23-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    68

    Re: Run a message box / macros based on cell value.

    Sorry spoke too soon, the cell with the data (M10) is driven by the below formula to work out age.

    Please Login or Register  to view this content.
    Any idea how to make it work with this?

  6. #6
    Forum Contributor
    Join Date
    01-31-2007
    Location
    Aschaffenburg, Germany
    MS-Off Ver
    Office 2013
    Posts
    104

    Re: Run a message box / macros based on cell value.

    The following macro will be executed each time the content of cell C12 is changed:
    Please Login or Register  to view this content.
    However, if there are any other cells that can influence the value of C12, this will not be sufficient.

  7. #7
    Forum Contributor
    Join Date
    01-31-2007
    Location
    Aschaffenburg, Germany
    MS-Off Ver
    Office 2013
    Posts
    104

    Re: Run a message box / macros based on cell value.

    You could either leave the
    Please Login or Register  to view this content.
    out of the code, but this would trigger a message box each time you Change ANY cell in that sheet and either the OVER or UNDER criteria apply, which can be quite annoying.

    In case you know which other cells have an influence on C12, you could limit the execution of
    Please Login or Register  to view this content.
    to cases where it makes sense.

  8. #8
    Forum Contributor
    Join Date
    01-31-2007
    Location
    Aschaffenburg, Germany
    MS-Off Ver
    Office 2013
    Posts
    104

    Re: Run a message box / macros based on cell value.

    Maybe that's the "solves it all" version:
    Please Login or Register  to view this content.
    If any cells is changed from which M10 is an dependent, the message box will be shown when OVER or UNDER criteria are met.

  9. #9
    Forum Contributor
    Join Date
    01-31-2007
    Location
    Aschaffenburg, Germany
    MS-Off Ver
    Office 2013
    Posts
    104

    Re: Run a message box / macros based on cell value.

    Maybe that's the "solves it all" version:
    Please Login or Register  to view this content.
    If any cells is changed from which M10 is an dependent, the message box will be shown when OVER or UNDER criteria are met.

+ 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. Error message about macros - but I have no macros in my file?!
    By Hshah in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-15-2016, 09:39 AM
  2. [SOLVED] auto Populate message on cell B based on input on cell A
    By dineshsachidananda in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-22-2014, 03:26 PM
  3. [SOLVED] how to pop up a message based on a cell value??
    By paul in forum Excel General
    Replies: 6
    Last Post: 02-27-2014, 03:41 AM
  4. [SOLVED] VBA- How to have message box appear based on cell info
    By Catniption in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2013, 03:38 PM
  5. Replies: 1
    Last Post: 01-28-2012, 11:51 AM
  6. 'Enable Macros' message with no macros
    By nebb in forum Excel General
    Replies: 1
    Last Post: 06-07-2007, 07:04 AM
  7. How to display a pop message based on a cell value
    By ashvik in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2006, 11:05 AM

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