Pop up message if the value resulted from formula is higher than a certain value

free2rhime

New Member
Joined
Feb 4, 2022
Messages
4
Office Version
  1. 2013
Platform
  1. Windows
Hello,



I have a file were each row coresponds with food choices from the catering firm, for a certain employee , and on the same row in BR3 there is the calculated total ammount based on the food they choose in the cells (D3: BQ3).



I want a pop up message to be displayed if the value calculated in BR3 is greater than 116.



Also i want to replicate this pop up for each row in the table so the range of cells, were the formula with total ammount is , will be B3:B67.



I tried data validation by choosing Allow: Whole number->Greater than->Minimum:116 or Custom -> Formula:BR3>116



Also if this works i whant to protect from editing the cells that calculate the total ammount, if this information is helpful in a vba code.



Thank you.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
This what I came up with but with a macro. It has to be pasted in the sheet's module.
It tests all formulas in ranges BR3 + B3:B67 which .Precedents are been updated and shows a popup when one of these formulas is greater than 116.
Have a try and see if you can use it in your project.
VBA Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("BR3", "B3:B67").Precedents) Is Nothing Then
        If Target.Dependents > 116 Then MsgBox "Cell " & Target.Dependents.Address & " has exceeded it's maximum value."
    End If
End Sub
 
Last edited:
Upvote 0
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Pop up message if the value resulted from formula is higher than a certain value - OzGrid Free Excel/VBA Help Forum
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
This what I came up with but with a macro. It has to be pasted in the sheet's module.
It tests all formulas in ranges BR3 + B3:B67 which .Precedents are been updated and shows a popup when one of these formulas is greater than 116.
Have a try and see if you can use it in your project.
VBA Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("BR3", "B3:B67").Precedents) Is Nothing Then
        If Target.Dependents > 116 Then MsgBox "Cell " & Target.Dependents.Address & " has exceeded it's maximum value."
    End If
End Sub
Hello and thank you for your help.

Unfortunately it still doesn't work because it generates " Run time error '13': Type mismatch for this line of code:

1644219029328.png


I would like to attach the file but i work on a virtualized server machine for work and there are restictions to install software so i can't install XL2BB Addon.
 
Upvote 0
Hello and thank you for your help.

Unfortunately it still doesn't work because it generates " Run time error '13': Type mismatch for this line of code:

View attachment 57171

I would like to attach the file but i work on a virtualized server machine for work and there are restictions to install software so i can't install XL2BB Addon.
I posted this questions also on

Pop up message if the value resulted from formula is higher than a certain value - OzGrid Free Excel/VBA Help Forum
 
Upvote 0
Sorry, but now that I've seen your file I must say that I'm unable to adapt my previous suggestion to your project.
 
Upvote 0
Upvote 0
Solution

Forum statistics

Threads
1,214,641
Messages
6,120,685
Members
448,978
Latest member
rrauni

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