Excel Conditional Popup Message

shickey

New Member
Joined
May 17, 2004
Messages
22
HI,

I have a worksheet with 3 cells in it. One cell is "Total", the second cell is "Adjustment" and the third cell is "Variance".

How can I create a popup message that states "Adjustment is Below the Total" and show the variance in the Variance cell in the event that the Adjustment value is below the Total value ?

Thanks
Shickey :rolleyes:
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi - Welcome to the board

You can try something like this in the worksheet change events

If adjustment < total then
msgbox "Adjustment is Below the Total"
end if

Post back with the ranges of these calculations if you need more help.
 
Upvote 0
HI


Thanks for the help....yep,,,,,I be a newbie

Here is what I poked in. It didn't work. Did I poke it in right ?

Private Sub Worksheet_Change(ByVal Target As Range)
If h20 < h19 Then
MsgBox "Adjustment is Below the Total"
End If
End Sub



Thanks
 
Upvote 0
Close, try this instead.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Range("H20").Value < Range("H19").Value Then
        MsgBox "Adjustment is Below the Total"
    End If

End Sub
 
Upvote 0
Hi,

Got one little snag. If H20 is 0 (zero), I get a runtime 13 error. Do you know how to adjust the formula so a zero does nothing but entry into H20 creates the conditional popup message ?



Thanks

:rolleyes:
 
Upvote 0
Hi Shickey:

I do not get any run time error with H20 as 0. However you can use the following modification for no message in case H20 is 0 ...
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Range("H20").Value <> 0 And Range("H20").Value < Range("H19").Value Then
        MsgBox "Adjustment is Below the Total"
    End If
end sub
 
Upvote 0
I was wondering if someone could help me. I have created a spreadsheet that compare a rolling expenses spend to a budget. I have setup condition monitoring so that if the spend is 0-75% of budget the 'spendtodate' field is green, 75-90% its amber and 90+% is goes red.
I am trying to get excel to throw up a warning box to the user if the field goes red. So he knows he is near the upper limit of his budget.
Regards,
Colin
 
Upvote 0

Forum statistics

Threads
1,216,081
Messages
6,128,696
Members
449,464
Latest member
againofsoul

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top