Addition between two defined cells
I work with long spreadsheets that vary in length but never more than 30,000 rows. Within these rows are some empty rows and a header, which all need to be ignored. Because of these conditions I am trying to define a range from top to bottom of each column. I have the code written to the point that I am ready to sum (or avg) between the two defined cells "toprow" & "bottomrow". I can't get the code to perform the calculation.
Below is what I have so far. The last line is where I'm stuck.
col = Selection.Column
toprow = ActiveCell.Value
bottomrow = ActiveCell.Value
ActiveCell.Formula = "=Sum.range(toprow:bottomrow)"