Find a blank line and put in a formula
Something is wrong in the frase:
cell.Offset(0,1).FormulaR1C1 ="=Average(R[" & -RowCount&"]C[-1]:R[-1]C[-1])"
Cant figuer out what is wrong.
I also want to calculate the average from column H to column AB
Sverre skrev:
Thank you, this was perfect, but if i want to start the calculation from
column. G ?
ryguy7272 skrev:
This will calculate multiple averages, at each blank. If you just have one,
that will work too:
Sub PutInAverage()
Dim myA As Range
For Each myA In Selection.SpecialCells(xlCellTypeConstants, 23).Areas
myA.Cells(myA.Rows.count + 1, 1).Resize(1, myA.Columns.count).Formula = _
"=Average(" & myA.Columns(1).Address(False, False) & ")"
Next myA
End Sub
HTH,
Ryan---
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.
"Sverre" wrote:
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 ?
|