Good question. That last amcro looked for a used range, so that may not work
as well for you, as the one below, if you have a specific column that you
want to find the avewrage for. Try this:
Sub subaveragetest()
'place a subtotal in column(V) wherever column(U) has a blank cell
Dim lRow As Long
Dim cell As Range
Dim RowCount As Long
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
lRow = Range("G65536").End(xlUp).Row + 1
RowCount = 0
For Each cell In Range("G2:G" & lRow)
If IsEmpty(cell) Then
cell.Offset(0, 1).FormulaR1C1 = "=Average(R[" & -RowCount &
"]C[-1]:R[-1]C[-1])"
RowCount = 0
Else
The logic should kind of make sense, right. Look at the Gs in the code. I
think you can figure it out!!
HTH,
Ryan---