Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi,
Since we don't know how your data is laid out we can't propose the actual code but here is an example in which you select the top row of the cells you want to sum: Sub AddFormula() Dim Bot As String Dim Top As String Dim cell As Range For Each cell In Selection Bot = cell.End(xlDown).Address Top = cell.Address Range(Bot).Offset(1, 0) = "=SUM(" & Top & ":" & Bot & ")" Next cell End Sub -- If this helps, please click the Yes button. Cheers, Shane Devenshire "Akilah" wrote: I have a function that exports rows of data to an Excel spreadsheet template. Is there a way to dynamically show the sum of each column after the last row of data since my function may not always export the same amount of rows. I always want to show the sum to the rows after the last row of data. Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dynamically create range of rows | Excel Discussion (Misc queries) | |||
Dynamically display in Active Cell value from 2 rows above it | Excel Discussion (Misc queries) | |||
Insert a specified number of rows dynamically | Excel Worksheet Functions | |||
Dynamically OCntrolling Rows | Excel Worksheet Functions | |||
formula to use when number of rows changes dynamically | Excel Worksheet Functions |