title: Macro to Copy and Paste down Variable Number or Rows from Record Count on Second Tab
body: <p>I have an Excel workbook with 2 tabs: "Data", and "Report". Each tab has a header row (row 1).</p>
  
  <p>Every time I run a new report, I'll paste new data onto the "Data" tab. The "Report" tab includes some formulas that reference data on the "Data" tab. I want to be able to create a Macro to copy-down the formulas on the "Report" tab to the corresponding number of rows from the "Data" tab. (The number of rows will vary each time I run the report).</p>
  
  <p>For simplicity sake, let's say on the "Report" tab, I have a header row and the some formulas in A2 &amp; B2. I want to be able to run a Macro that will copy-down these formulas for the corresponding number of rows to the row count for the "Data" tab.</p>
  
  <p>I've found the following code - but am not sure how to modify it to meet my needs:</p>
  
  <p>Sub CopyValueDown()
  Dim lRow As Integer</p>
  
  <pre><code>Sheets("Data").Select
  lRow = Range("A" &amp; Rows.Count).End(xlUp).Row
  If lRow = 1 Then GoTo End
  Range("A1:B1").AutoFill Destination:=Range("A1:B" &amp; lRow)
  End Sub
  </code></pre>
  
  <p>Any suggestions?</p>