title: Auto sum the values till the first encounter of blank cell in a column
body: <p>Am trying to open a new workbook and sum the values in the Column "A" and paste in the first blank cell. But the sum doesn't show in the blank cell.</p>
  
  <pre><code>Path = ActiveWorkbook.Path
  Filename = InputBox("Enter an input file name")
  MsgBox Filename
  InputFile = Path &amp; "\"
  
  InputFile = InputFile &amp; Filename
  MsgBox InputFile
  Workbooks.Open Filename:=InputFile
  
  'Activating the Raw Data Report
  Set InputFile = ActiveWorkbook
  Set InputFileSheet = InputFile.Sheets("Sheet1")
  InputFileSheet.Select
  InputFileSheet.Activate
  
  Set r = Range(Range("A1"), Cells(Rows.Count, "A"))
  Cells(Rows.Count, "A").End(xlUp).Offset(1, 0) = Application.WorksheetFunction.Sum(r)
  </code></pre>