title: VBA to AutoSUM selected Range
body: <p>I am working on automating some reports by pasting data from raw files into my Template called PA Reach. I have named a range "Sumrow" and I need VBA to autosum the numbers above in each of the loops after pasting the data in. Here is what I have and I'm getting errors:</p>
  
  <pre><code>Workbooks.Open datapath &amp; datafile1 &amp; OutputFileExt
    Sheets("Rep").Activate
    ActiveSheet.UsedRange.AutoFilter        
  
    For i = 1 To terrs_to_generate
      Workbooks(builder).Sheets("Control").Activate
  
      Range("Reportnum") = i
      currfile = Range("CurrFile").Value
      currterr = Range("CurrTerr").Value
      currRep = Range("currRep").Value
      terrname = Range("terrname").Value
      DMName = Range("DMName").Value
      TMStartDate = Range("TMstartdate").Value
  
      'open template
      Workbooks.Open templatepath &amp; templatefile &amp; OutputFileExt
  
      Set currtemplatefile = ActiveWorkbook
  
      Sheets("Control").Select
      Sheets("control").Range("terrname") = terrname
      Sheets("control").Range("repname") = currRep
      Sheets("control").Range("reportdate") = reportdate
      Sheets("control").Range("TMstartdate") = TMStartDate
      Sheets("control").Range("DMName") = DMName
      Sheets("control").Range("Territory") = currterr
  
      Workbooks(datafile1 &amp; OutputFileExt).Activate
      Selection.AutoFilter field:=1, Criteria1:=currterr
  
      Range("A1").Select
      Range(Selection.Offset(1, 1).End(xlDown), Selection.End(xlToRight)).Copy
      currtemplatefile.Activate
      Sheets("PA Reach").Select
      Range("pasterange").Select
      Selection.PasteSpecial Paste:=xlPasteValues
  
      currtemplatefile.Activate
      Range("formatrow").Copy
  
      Range("pasterange").Select
      Range(Selection.End(xlToRight), Selection.End(xlDown).Offset(0, 0)).Select
      Selection.PasteSpecial Paste:=xlPasteFormats
  
      'Delete PasteRange
      Range("pasterange").Select
      Selection.EntireRow.Delete
  
      'Value Range Sheet so no formulas show
      ActiveSheet.UsedRange.Select
      Selection.Copy
      Selection.PasteSpecial Paste:=xlPasteValues
  
     Range("A1").Select
  
  
  
   Sheets("control").Delete
  'need to add in sum total
  Range("sumrow1").End(xlDown).Offset(1, 0) = "=Sum(" &amp; Range("sumrow1").Address(True, True) &amp; ")"
  
  
  
      'save as and close
       ActiveWorkbook.SaveAs Filename:=(reportpath &amp; currfile &amp; OutputFileExt)   'not working
  </code></pre>