Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sum unknown length column data in VBA
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sum unknown length column data in VBA
Hi John,
Try: Cells(z, 6).Formula = "=SUM(F5:F" & bottom & ")" --- Regards, Norman "John" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sum unknown length column data in VBA
Sub Macro1() ' ' Macro1 Macro ' Range("F5").End(xlDown).Name = "finish" Range("finish").Offset(1, 0).Formula = "=SUM (f5:finish)" End Sub -----Original Message----- 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 . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sum unknown length column data in VBA
as a (simpler?) alternative I'd use:
.formular1c1 = "=sum(r5c:r[-1]c)" keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool (John) wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Finding a string of unknown length in a string of unknown length, Help! | Excel Discussion (Misc queries) | |||
How to sort column data regardless of col length | Excel Worksheet Functions | |||
SMALL() on unknown length of list | Excel Worksheet Functions | |||
How do I sort a large column of data by length? | Excel Worksheet Functions | |||
How I type SOLD across column length without changing current data | Charts and Charting in Excel |