Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you all for the help!!!!
"Tom Ogilvy" wrote: Looks like I had a typo: Sub AddSum() Dim rng As Range Set rng = Cells(Rows.Count, ActiveCell.Column).End(xlUp)(2) If rng.Row 8 Then rng.FormulaR1C1 = "=Sum(R8C:R[-1]C)" End If End Sub -- Regards, Tom Ogilvy "Tom Ogilvy" wrote: Assuming you want the sum in the activecolumn and the top number to sum is in row 8: Sub AddSum() Dim rng as Range set rng = cells(rows.count,activecell.column).end(xlup)(2) if rng.row 8 then rng.FormulaR1C1 = "=Sum(R8C:R[-1]C)" end Sub End Sub -- Regards, Tom Ogilvy "Annoyed Accountant" wrote: This has got to be easier than I am making it. I need (via VBA) to locate the end of a column of numbers, go one below the numbers (a blank cell) and enter a formula that will calculate the sum of the numbers above. Since the amount of data changes, this is what I have so far: Range("D8").Select ' this is where my data starts (absolute reference) Selection.End(xlDown).Select ' goes to last cell of data Cells.Offset(0, 1).Select ' goes down one cell from that Now, how do I enter sum(d8:?) How do I refer to the offset cell without using absolute references in my formula? I tried using a macro, but excel automatically used absolute references. Thanks in advance for the help. This shouldn't be difficult! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
large function result as reference for offset function | Excel Discussion (Misc queries) | |||
Offset function | Excel Worksheet Functions | |||
XL2002 - OFFSET function and LARGE function | Excel Worksheet Functions | |||
Offset function with nested match function not finding host ss. | Excel Worksheet Functions | |||
offset function | About this forum |