title: Running a VBA code whenever you change the row you're editing
body: <p>I need to run a code in excel VBA whenever you change the row you're working on.</p>
  
  <p>My code updates other Workbooks whenever you edit something, but since all the information in a row is supposed to update 1 Workbook, I want it to open and update that other Workbook only when you stop working in a row (any row)</p>
  
  <p>Right now I have a code that updates the other workbook when I change a cell, so this is what I have.</p>
  
  <pre><code>Private Sub Worksheet_Change(ByVal Target As Range)
      Dim KeyCells As Range
      Set KeyCells = Range("A1:C10")
      Dim WB As Workbook
      Dim dirFile As String
      Dim strFile As String
      Dim Actual As Workbook
      Static lngRow As Long
      Dim linea
      Set Actual = ActiveWorkbook
      If Not Application.Intersect(KeyCells, Range(Target.Address)) _
             Is Nothing Then
          MsgBox "Cell " &amp; Target.Address &amp; " has changed."
          dirFile = "N:\Otros\sebastian\TEST 2\"
          strFile = Trim(Cells(Target.Row, 1).Value)
          If Len(Dir(dirFile &amp; strFile &amp; ".xlsx")) = 0 Then
              Application.Visible = False
  
              linea = Target.Row
              Set WB = Workbooks.Add
              ' ESTILO
              ' __________________________
              WB.Worksheets(1).Columns("A").ColumnWidth = 28
              ' ___________________________
              'DATOS
              '____________________________
  
              WB.Worksheets(1).Cells(1, 1).Value = "Titulo de Proyecto"
              WB.Worksheets(1).Cells(1, 2).Value = Actual.Worksheets(1).Cells(linea, 2)
              WB.SaveAs (dirFile &amp; strFile &amp; ".xlsx")
              WB.Close
              Application.Visible = True
  
  
          End If
  
  
  
      End If
  End Sub
  </code></pre>