ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   pop up message depending on cell value (https://www.excelbanter.com/excel-programming/335859-pop-up-message-depending-cell-value.html)

John Davies

pop up message depending on cell value
 
is it possible to have different messages automatically pop up depending on
certain cell values. e.g. if a1=6 a message would pop up with "correct", if
a1=7 a message would pop up with "incorrect", if a1=8 a message would pop up
with "try again" etc.

moi

pop up message depending on cell value
 
In VB Editor (ALT-F11) double click Sheet1, then paste

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
If Target = 6 Then
MsgBox "Correct"
ElseIf Target = 7 Then
MsgBox "Incorrect"
ElseIf Target = 8 Then
MsgBox "Try again"
End If
End If
End Sub


"John Davies" schreef in bericht
...
is it possible to have different messages automatically pop up depending
on
certain cell values. e.g. if a1=6 a message would pop up with "correct",
if
a1=7 a message would pop up with "incorrect", if a1=8 a message would pop
up
with "try again" etc.





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

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