VBA - MsgBox Based on Cell Value
GustavoSRP
Posted messages
8
Status
Member
-
yg_be Posted messages 23437 Registration date Status Contributor Last intervention -
yg_be Posted messages 23437 Registration date Status Contributor Last intervention -
Hello everyone,
Thank you in advance for your help.
I am a beginner with VBA in Excel.
I need to display a MsgBox based on the value of a given range of cells.
For example:
If the values in the range (A1:A41) are greater than 29.99, a MsgBox should appear with a "text X"
Please take into account that there is a formula in the range of cells that gives the result.
A big thank you to everyone
Gustavo
Thank you in advance for your help.
I am a beginner with VBA in Excel.
I need to display a MsgBox based on the value of a given range of cells.
For example:
If the values in the range (A1:A41) are greater than 29.99, a MsgBox should appear with a "text X"
Please take into account that there is a formula in the range of cells that gives the result.
A big thank you to everyone
Gustavo
3 answers
-
Hello
What have you started?
What are you stuck on?
Focus on the private sub worsheet_change(target) event
Target contains the modified cell
All you have left to do is use some if... And you're good to go
--
Best regards,
Jordane -
Hello, when should the message appear? Upon opening the file?
You write "the displayed values are greater than 29.99": do you want to display the message only if all values are greater? -
The values of each cell change because each cell refers to another cell that performs an addition. The cell in question calculates the average amount over 52, for example.
Cell A1 contains the following formula: =B1/52
Cell B1 contains the following formula: SUM(B2:B12)
When cell A1 exceeds 29.99, a text message must appear.
So, when one or more cells in the range (''A1:A50'') reach 30 or more, the text message is displayed.