Sum unknown length column data in VBA

  • Thread starter Thread starter John
  • Start date Start date
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
 
Sub Macro1()
'
' Macro1 Macro
'
Range("F5").End(xlDown).Name = "finish"
Range("finish").Offset(1, 0).Formula = "=SUM
(f5:finish)"
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top