+ Reply to Thread
Results 1 to 5 of 5

To have a message box for highlighted cell by conditional formatting

  1. #1
    Registered User
    Join Date
    03-12-2015
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    3

    To have a message box for highlighted cell by conditional formatting

    Hi All,

    I hope you guys are really able to help as I am at my wit's end.
    I am trying to compare Column I to Column E, and highlight it if it is more than 50% PLUS a message box is to appear just to alert the user.

    I've used conditional formatting of this equation:

    = OR(I12>E12*0.5)


    And message box specific for this line:

    Private Sub Worksheet_Calculate()
    Dim myMessage As String

    myMessage = ""

    If Range("I12").Value > Range("E12").Value * 0.5 Then
    If (myMessage <> "") Then myMessage = myMessage & vbCrLf
    myMessage = myMessage & "Please note that the number is greater than 50% of the athletes"

    End If

    If (myMessage <> "") Then MsgBox (myMessage)
    End Sub

    The above is only for specifically line 12. How do I check for every row to highlight if each cell in column I is not greater than E and if it is greater than E, a message box should appear?

    My first post Thanks!
    Attached Images Attached Images
    Last edited by suki88; 03-12-2015 at 11:37 PM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: To have a message box for highlighted cell by conditional formatting

    try this,

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-12-2015
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    3

    Re: To have a message box for highlighted cell by conditional formatting

    Woah Dave!

    Looks and works great! Thank you so much!


    But may we tweak it as the message box is like a one-off alert, in which, if i were to start filling up the other cells, the pop-up would not appear until the next cell in "I" is greater than 50%.

    As of now, each time I try to fill a new row with data, the pop up appears as the row E12 is still greater than 50%. Able to help with the tweaking?

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: To have a message box for highlighted cell by conditional formatting

    Then you can't use worksheet calculate.
    What column are you entering, that you want to trigger a code?

  5. #5
    Registered User
    Join Date
    03-12-2015
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    3

    Re: To have a message box for highlighted cell by conditional formatting

    Hi Dave,

    Sorry for the late response.


    Maybe I'll explain a little more in detail.

    Column E is generated by the sum of column C & D of that row (inputs from user) as well as I which is a sum of Col G & H (also inputs from the user).

    The only catch is, once Col I is > 50% than Col E, a pop-up message alerts the user that the cell is > 50% than E and it will highlight the cell (I'm already using conditional formatting for this) and the pop up message will not appear till the next cell in I satisfies the above condition.


    Thank you so much Dave

+ 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. deleting non highlighted cells after conditional formatting
    By Wanda Almeida in forum Excel General
    Replies: 2
    Last Post: 08-13-2013, 06:44 PM
  2. Deleting rows not highlighted by conditional formatting
    By JakeMann in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-14-2013, 08:01 AM
  3. Macro to find Red Highlighted cells from Conditional Formatting
    By aharvestofhealth in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-02-2012, 10:22 AM
  4. Replies: 3
    Last Post: 06-07-2011, 08:41 AM
  5. Replies: 6
    Last Post: 08-21-2009, 12:11 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