title: Copy entire row to different sheet using VBA
body: <p>I have attached the Excel file for reference.</p>
  
  <p>In the "Input" sheet there is a production schedule that will be generated on submit button click. The same schedule will also have to COPIED in "Output" sheet. But I am not able to paste it in the desired location (blue highlighted area).</p>
  
  <p>Another challenge is to retain relevant data corresponding to year and clear the rest.<br>
  That means suppose it is a schedule for 34 years. Now if I again generate it with 20 years it will keep the values of class I and class II till 20 years only and clear the rest.</p>
  
  <p>The same has to be in the Output sheet.</p>
  
  <p>The code within Submit_Click:</p>
  
  <pre><code>Sub Submit_Click()
  Dim no_years As Integer
  Dim i_val As Integer
  Range("c10").Activate
  
  ActiveCell.EntireRow.Clear
  
  ActiveCell = Range("b3").Value
  no_years = Range("b4").Value
  i_val = Range("b5").Value
  
  Do While no_years &gt; 0
      ActiveCell.Offset(0, 1).Activate
      ActiveCell.Value = DateAdd("YYYY", i_val, ActiveCell.Offset(0, -1).Value)
  
      no_years = no_years - 1
  Loop
  
  ' copy production schedule calender to all sheets
  ActiveCell.EntireRow.Copy Destination:=Sheets("Output").Range("A" &amp; Rows.Count).End(xlUp).Offset(1)
  
  MsgBox ("Production schedule calendar generated")
  End Sub
  </code></pre>