Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to have different messages pop up, e.g. if cell a1 = 1, a
message will pop p showing "Correct" with red bold text, if cell a1 = 2, message popus will show "Incorrect" with blue bold text etc. Thanks in advance of any help. John |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
You could use worksheet event code to display a message box. But message boxes do not allow formatting of the message. For that you would need to use a userform. Would the choice of red for correct not confuse the user? Red normally indicates a warning, bad or incorrect status. Can you not use conditional formatting to change the cells pattern colour? Cheers Andy John Davies wrote: Is it possible to have different messages pop up, e.g. if cell a1 = 1, a message will pop p showing "Correct" with red bold text, if cell a1 = 2, message popus will show "Incorrect" with blue bold text etc. Thanks in advance of any help. John |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Andy
Yes I could use conditional formatting to change text colour, therefore could you please show me what worksheet event code I should use to show the different messages as I do not any experience of coding Thanks John "Andy Pope" wrote: Hi, You could use worksheet event code to display a message box. But message boxes do not allow formatting of the message. For that you would need to use a userform. Would the choice of red for correct not confuse the user? Red normally indicates a warning, bad or incorrect status. Can you not use conditional formatting to change the cells pattern colour? Cheers Andy John Davies wrote: Is it possible to have different messages pop up, e.g. if cell a1 = 1, a message will pop p showing "Correct" with red bold text, if cell a1 = 2, message popus will show "Incorrect" with blue bold text etc. Thanks in advance of any help. John |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this John,
Right click on the sheet tab and pick View code. Paste code. Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Range("A1"), Target) Is Nothing Then If Target.Value = 1 Then MsgBox "Value " & Target.Value & _ " in A1 is correct", vbInformation Else MsgBox "Value " & Target.Value & _ " in A1 is incorrect", vbExclamation End If End If End Sub It checks that the change cell is A1. If so it checks the value is 1 and displays an appropriate message box. Cheers Andy John Davies wrote: Hi Andy Yes I could use conditional formatting to change text colour, therefore could you please show me what worksheet event code I should use to show the different messages as I do not any experience of coding Thanks John "Andy Pope" wrote: Hi, You could use worksheet event code to display a message box. But message boxes do not allow formatting of the message. For that you would need to use a userform. Would the choice of red for correct not confuse the user? Red normally indicates a warning, bad or incorrect status. Can you not use conditional formatting to change the cells pattern colour? Cheers Andy John Davies wrote: Is it possible to have different messages pop up, e.g. if cell a1 = 1, a message will pop p showing "Correct" with red bold text, if cell a1 = 2, message popus will show "Incorrect" with blue bold text etc. Thanks in advance of any help. John |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could use the msgbox display types to have a different look:
Private Sub Worksheet_Change(ByVal Target As Range) If Range("A1").Value = 1 Then MsgBox "Incorrect", vbExclamation ' Warning Look Range("A1").Activate If Range("A1").Value = 2 Then MsgBox "Correct", vbInformation ' Question Mark Range("A1").Activate End Sub Corey.... "John Davies" wrote in message ... Is it possible to have different messages pop up, e.g. if cell a1 = 1, a message will pop p showing "Correct" with red bold text, if cell a1 = 2, message popus will show "Incorrect" with blue bold text etc. Thanks in advance of any help. John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Messages | Excel Worksheet Functions | |||
Not getting messages in OE | Excel Worksheet Functions | |||
Msg.box -messages | Excel Discussion (Misc queries) | |||
Pop up messages | Excel Programming | |||
Messages not available | Excel Programming |