Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Is it possible to have different pop up messages to appear

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Is it possible to have different pop up messages to appear

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Is it possible to have different pop up messages to appear

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Is it possible to have different pop up messages to appear

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Is it possible to have different pop up messages to appear

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Messages Link[_2_] Excel Worksheet Functions 1 September 25th 09 09:04 PM
Not getting messages in OE Biff Excel Worksheet Functions 2 November 1st 06 08:01 AM
Msg.box -messages TUNGANA KURMA RAJU Excel Discussion (Misc queries) 4 January 6th 06 04:33 AM
Pop up messages Manos[_2_] Excel Programming 3 November 2nd 03 07:49 PM
Messages not available Otto Moehrbach[_5_] Excel Programming 1 September 30th 03 07:21 PM


All times are GMT +1. The time now is 09:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"