title: Regression macros in excel with increasing rows of data
body: <p>Basically, I recorded a macros in excel to run a regression based on the data sets I have. However, I will be adding new data in more rows. For example, I have 16 rows of Y and 16 rows of X. In the following day, I will be adding 1 more row of Y and X. However, my macros will only run the regression for the data in the first 16 rows. How can I program my macros such that it takes into account all the data rows that exist? My macros code is:</p>
  
  <pre><code>Sub Regression()
  '
  ' Regression Macro
  '
  
  '
  Application.DisplayAlerts = False
  Sheets("REGRESSION").Select
  ActiveWindow.SelectedSheets.Delete
   Application.Run "ATPVBAEN.XLAM!Regress", ActiveSheet.Range("$A$1:$A$16"), _
      ActiveSheet.Range("$B$1:$F$16"), False, True, , "REGRESSION", False, _
      False, False, False, , False
  Application.DisplayAlerts = True
  End Sub
  </code></pre>
  
  <p>Thanks!</p>