Sum unknown length column data in VBA

J

John

All, I really appreciate the help from this group of talented people.

I want to add a formula in the 6th column, one row after the bottom
row of data, summing from F5 to F "bottom".
I know I'm close, but something here is wrong.

Sub ColTots()

Dim z As Long
Dim bottom As Long

bottom = Cells(Rows.Count, "B").End(xlUp).Row
z = bottom + 1

cells(z,6).formula = "=SUM("F5:F" & bottom)"


Thanks
john
 
J

John

Sub Macro1()
'
' Macro1 Macro
'
Range("F5").End(xlDown).Name = "finish"
Range("finish").Offset(1, 0).Formula = "=SUM
(f5:finish)"
End Sub
 
Top