title: Clearing an error when adding Rows to multiple Sheets
body: <p><em>Question: I want to set up a button that will allow a user to add a row to the active sheet they are working on. In the background I want the spreadsheet to add a row in another sheet in the same workbook in the same location as the one that was added. (the two sheets are identical only with the non active worksheet having info from the previous month) The reason I need it to do this is because the Active worksheet is pulling data from the inactive sheet and I want to keep the same number of rows in both sheets with the data on both in the same rows so it will pull the correct data.</em></p>
  <p>I added copying the formulas from the selection row as well so the user does not need to copy manually and I think that is what is causing the issue.</p>
  <p>Any idea on how to clear the error:</p>
  <blockquote>
  <p>Run-time error '1004':<br />
  PasteSpecial method of Range class failed</p>
  </blockquote>
  <p>Got the idea for the code I used at <a href="https://stackoverflow.com/questions/17715102/ms-excel-vba-how-to-insert-a-row-in-the-current-worksheet-and-three-others">MS Excel VBA how to insert a row in the current worksheet and three others</a></p>
  <p>My code</p>
  <pre><code>Sub AddRow()
  '
  ' Row Macro
  
  
      ActiveWorkbook.Names.Add Name:=&quot;CopyRow&quot;, RefersToR1C1:=Rows(ActiveCell.Row)
      
      Range(&quot;CopyRow&quot;).Select
      
      Selection.Copy
      
      Dim Lst As Long
  
      Lst = ActiveCell.Row
  
      Worksheets(&quot;SOV Detailed Breakdown&quot;).Rows(Lst).Insert
      Worksheets(&quot;Previous Application&quot;).Rows(Lst).Insert
   
      Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
      SkipBlanks:=False, Transpose:=False
  
  
      ActiveWorkbook.Names(&quot;CopyRow&quot;).Delete
  
  End Sub
  </code></pre>