If you really need to have the result on the last user-selected row,
then you will need to do the following:
Logic statement:
' User selects a range in column A, and then presses the "Do Column C
Now" button.
' Determine the top and bottom rows the user has selected.
' Put the formula in the correct row in Column C, using offset.
Actual Code:
Sub DoColumnCNow()
Dim Start_Row, Number_Of_Rows As Integer
' Determine the top and bottom rows the user has selected.
Start_Row = Selection.Row
Number_Of_Rows = Selection.Rows.Count
' Put the formula in the correct row in Column C, using offset.
Range("A" & Start_Row).Offset(Number_Of_Rows - 1, 2).Formula =
"=SUM(""A" & Start_Row & ":A" & Start_Row + Number_Of_Rows - 1 & "") /
2000
End Sub
------------------------------------------------------------------------
-----------
Now, my formula has a mistake in. See if you can fix the compile error,
and it will work. Or anyone else, please. Too late for my brain today.