title: Excel VBA, code in worksheet not working
body: <p>I have the following code in sheet1 (note - this code is in the wroksheet object, not the workbook object or a module):</p>
  
  <pre><code>Private Sub Worksheet_Change(ByVal Target As Range)
  Dim r As Integer
  r = ActiveCell.Row
  Cells(r - 1, 7).Value = Now()
  ActiveWorkbook.save
  End Sub
  </code></pre>
  
  <p>Can someone tell me why:
  1. the ActiveWorkbook.save doesnt work above - it gets stuck in an infinite loop instead;
  2. why I cant step throught the code by just pressing F8</p>
  
  <p>I tried to put the ActiveWorkbook.save in a separate module and then call that function from the code in the worksheet but that got stuck in an infinite loop as well.</p>