ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   warning box (https://www.excelbanter.com/excel-worksheet-functions/162915-warning-box.html)

delete automatically

warning box
 
How can I have a message come up when a cell breaks a record.
Example
if A4 is greater than 50 the say new record

JW[_2_]

warning box
 
On Oct 20, 9:00 am, delete automatically
wrote:
How can I have a message come up when a cell breaks a record.
Example
if A4 is greater than 50 the say new record


You mean an actual message box? If so, right click the sheet tab
where you want this to take place and select View Code. Then paste
something like this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("A4").Text 50 Then _
MsgBox "New Record!!!"
End Sub


Debra Dalgleish

warning box
 
You can use data validation to display a message. There are instructions
in Excel's Help, and he

http://www.contextures.com/xlDataVal01.html

delete automatically wrote:
How can I have a message come up when a cell breaks a record.
Example
if A4 is greater than 50 the say new record



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html


delete automatically

warning box
 
JW, that worked perfectly. But how can I change the 50 to something else
without getting a compilr error?
Thanks

"JW" wrote:

On Oct 20, 9:00 am, delete automatically
wrote:
How can I have a message come up when a cell breaks a record.
Example
if A4 is greater than 50 the say new record


You mean an actual message box? If so, right click the sheet tab
where you want this to take place and select View Code. Then paste
something like this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("A4").Text 50 Then _
MsgBox "New Record!!!"
End Sub




All times are GMT +1. The time now is 05:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com