title: Code run automatically on changing cell value in Excel
body: <p>I am trying to run some VBA script to run automatically when I change a cell value automatically. I do have the script int he Worksheet and not a module. For some reason it is not working and I can't figure out why. Anyone have any idea why? Thanks so much! </p>
  
  <pre><code>Private Sub Worksheet_Change(ByVal Target As Range)
  
  If Target = Range("B1") Then
  
  
  r1 = Range("B1").Value
  Range("A1").Value = 2 * r1
  
  End If
  
  End Sub
  </code></pre>