POP up msg in excel when condition is TRU

Closed
remo - Oct 3, 2009 at 09:55 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Nov 9, 2011 at 07:46 PM
Hello,

I want to get a pop up message in excel when a condition is TRUE. I am bringing in live data and want to notified through pop up when the number in the cell is less than or greater than a specified number
Related:

4 responses

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Oct 4, 2009 at 01:24 AM
complete information is not available. is the data imported in one cell, one row or one column or a number of rows and columns . the following event code will pop up hte message wherever the data imported is less than 5. modify the codes if neesary

right click sheet tab and click view code
in the window that comes up copy paste this code

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target = "" Then Exit Sub
If Target.Value < 5 Then MsgBox "this value is  less than 5"
End Sub

got to that sheet type some number less than five in any cell see what happens.
1
Thanks for your response. The code works and am getting a pop up when I click on a cell wherein the condition is true. I have a range of cells I am looking at. Each cell has a value that is being updated through live data and is changing constantly, so I am trying to have it so that when the value updates and is true, the pop up happens without me having to click on the cell. Is it possible to set it so that when the value updates and is less than 5, I will get a pop up?
0
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Oct 4, 2009 at 09:19 PM
you have alraedy parked a code hy right clicking sheetab and clicking view code and in resuting wndow. In the same window park this code also

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = "" Then Exit Sub
If Target.Value < 5 Then MsgBox "this updated value is  less than 5"
End Sub


the earlier code fires only when you change the cell and enters a number
in the present code(Worksheet_Change) the msgbox will appear even if you update teh existing cell.
0
venkat,
I am also interested in this code but with a slight difference in that the value in my cell is as a result of a formula. Can you advise how, if it is possible, to change your code to accomodate this scenario.

Many thanks

Digimalt
0
What is you want this condition:

A pop up box to appear when a range of cells in one particular column is greater than 0.

Is there a code for this??
0
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Nov 9, 2011 at 07:46 PM
I am not clear what you want. but try this

change first line as

Private Sub Worksheet_Change(ByVal Target As Range)


and save the file and now test.
0