Worksheet_SelectionChange Problem

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:
 
B

Bernie Deitrick

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
 
C

Casey

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top