Excel VBA Target Worksheet change

B

bbcdancer

When I cut and paste the below MS excel macro into a new workbook
module sheet, it does not work?

I type the y in column c, this macro will not work...

Please help...



Private Sub Worksheet_Change(ByVal Target As Excel.Range)

If Target.Column = 3 Then

If (Target.Text = "y") Then

MsgBox "hello"

End If
End If

End Sub
 
D

Dave Peterson

This kind of code goes behind the worksheet.

If you rightclick on the worksheet tab that should have this behavior, you can
select view code.

Paste the code in that code window that just opened up.
 
Top