Change your column mc="f" to yours
This looks for the last cell in mc and then finds the 1st blank above and
then finds the next blank and places the average value in the bottom blank
cell. This case is 2.5 below the 2
6
1
3
2
1
Sub averageaboveblank()
mc = "f"
lr = Cells(Rows.Count, mc).End(xlUp).Row
MsgBox lr
For i = lr To 2 Step -1
If Cells(i, mc) = "" Then
br = i
Exit For
End If
Next i
MsgBox br
nextup = Cells(br - 1, mc).End(xlUp).Row
MsgBox nextup
Cells(br, mc) = _
Application.Average(Range(Cells(nextup, mc), Cells(br, mc)))
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"Sverre" wrote in message
...
Is it posible automaticly to fond a blank line an put in a formula to
calculate the average values above up to the next blank row ?