Worksheet_SelectionChange Problem

  • Thread starter Thread starter Casey
  • Start date Start date
C

Casey

Hi,
I'm trying to have a reminder message pop up when a certain cell i
selected. I would like to do this with VBA as opposed to doing it wit
a Data Validation input message. I've tried the following code but t
no avail. Here's the code followed by the error message.

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

If Target.Row = 5 And Target.Column = 6 Then
MsgBox = "Have you verified your Extra Material setting in cel
A1? Normal setting is 25."
End If

End Sub

I get the following error message:
 
Casey,

No equal sign on the MsgBox line:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

If Target.Row = 5 And Target.Column = 6 Then
MsgBox "Have you verified your Extra Material setting in cell A1? Normal setting is 25."
End If

End Sub

You can also modify other cells, or check the input value with the change event.

HTH,
Bernie
MS Excel MVP
 
Bernie,
Thanks for the help. Worked like a charm. Thanks for the adde
suggestions as well. I might have some uses for those in some othe
spreadsheet apps. Thanks again
 
Back
Top