Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear all,
I want to create a function (maybe just a common IW question in fact) to sum up a column, which have a dynamic number of rows! My user will retrieve data from DB and display in a column, but the number of row of this column is subjected to change, so I can't hardcode "=SUM(A1:A10)" at the end of the column. So I'd like to know how I can sum and display the total right after the last cell of that dynamic column? Thanks, |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
Use a dynamic name for your range using this formula in the "refers To" field: =OFFSET(A1;;;COUNTA(A:A)) Then use this new name in your formula (which obviously must NOT be placed in column A): =Sum(YourName) HTH Cordially Pascal "Peter" a écrit dans le message de news: ... Dear all, I want to create a function (maybe just a common IW question in fact) to sum up a column, which have a dynamic number of rows! My user will retrieve data from DB and display in a column, but the number of row of this column is subjected to change, so I can't hardcode "=SUM(A1:A10)" at the end of the column. So I'd like to know how I can sum and display the total right after the last cell of that dynamic column? Thanks, |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() lastrow = Columns("A:A").Find("*", [A1], , , xlByRows, xlPrevious).Row Range("A" & lastrow+1).formula="=SUM(A1:A" & lastrow & ")" Regards, Stefi €˛Peter€¯ ezt Ć*rta: Dear all, I want to create a function (maybe just a common IW question in fact) to sum up a column, which have a dynamic number of rows! My user will retrieve data from DB and display in a column, but the number of row of this column is subjected to change, so I can't hardcode "=SUM(A1:A10)" at the end of the column. So I'd like to know how I can sum and display the total right after the last cell of that dynamic column? Thanks, |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How about putting the formula
=SUM(A2:A65535) in the first row, makes it easier to find as well. -- HTH Bob Phillips (remove xxx from email address if mailing direct) "Peter" wrote in message ... Dear all, I want to create a function (maybe just a common IW question in fact) to sum up a column, which have a dynamic number of rows! My user will retrieve data from DB and display in a column, but the number of row of this column is subjected to change, so I can't hardcode "=SUM(A1:A10)" at the end of the column. So I'd like to know how I can sum and display the total right after the last cell of that dynamic column? Thanks, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
getting the absolute range address from a dynamic named range | Excel Programming | |||
Dynamic Range with unused formula messing up x axis on dynamic graph | Charts and Charting in Excel | |||
copying dynamic range based on cell outside of range | Excel Programming | |||
select dynamic range with dynamic start point | Excel Programming | |||
Excel 2000 VBA - Set Print Range in dynamic range | Excel Programming |