title: VBA Worksheet Change Event
body: <p>I am trying to use the Worksheet Change Event in Excel VBA, but it doesn't seem to work.</p>
  
  <p>From what I gather, it is enough to just define the handling function "Worksheet_Change" as I have done here:</p>
  
  <pre><code>Private Sub Worksheet_Change(ByVal Target As Range)
      Range("J1").Select
      If Target.Address = "$J$1" And ActiveCell.Value = 1 Then
          Range("B1").Select
          Dim c As Integer
          c = ActiveCell.Value
          c = c + 1
         ActiveCell.Value = c
      End If
  End Sub
  </code></pre>
  
  <p>The problem is that I am not sure exactly where I am supposed to define it. I have just put it in "module1" which was automatically generated when I made my first macro. Is this correct? I am quite new to VBA, so I don't know much about it yet.</p>