View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_2_] Patrick Molloy[_2_] is offline
external usenet poster
 
Posts: 1,298
Default message box keeps popping

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Range("G24").Value = "pop" Then
Msg = MsgBox("Both Values do not agree", vbOKOnly)
Range("G24")=""
End If
End Sub


"amelia" wrote:

I would like to make the message box pop automatically when cell G24="pop".
But the message keeps popping when i click to anywhere in the worksheet.

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Range("G24").Value = "pop" Then
Msg = MsgBox("Both Values do not agree", vbOKOnly)
End If
End Sub

Thanks for any help!