title: Range formula last row
body: <p>I am trying to grab the last cell for my average, so I have it pulling a count from column A since column A does not have blanks, and determines the stopping point for my other columns. This works for my range functions, but I keep getting a compile error for "Expected: end of statement" when I use the below.</p>
  
  <pre><code>Dim lastrow As Long
  lastrow = Cells(Rows.Count, "A").End(xlUp).Row
  Range("H2").Formula = "=IFERROR(AVERAGE("H3:H" &amp; lastrow), """")"
  </code></pre>
  
  <p>The output would be something like if column A had 200 lines, the forumla would input as =IFERROR(AVERAGE(H2:H200),"")</p>