ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   sum a range (https://www.excelbanter.com/excel-programming/425644-sum-range.html)

Brad

sum a range
 
I have a program that filters a table and should sum the visible rows in a
particular column and store the results in an array variable. This occurs
inside a for loop. Everything works fine except for the sum part. I'm not
sure what the correct code should be to accomplish this. Here is what I have,
which does not work. Is there a suitable replacement for this?
With workbooks("Data").Sheets("Sheet1").ListObjects("tb lData")

iLoop2PrevWeek(iLoopCount) = WorksheetFunction.Sum _
(.ListColumn(4).DataBodyRange.SpecialCells(xlCellT ypeVisible))

End with

Jacob Skaria

sum a range
 
Hi Brad, would you be able to provide more information on the structure of
the workbook and the full code.

If this post helps click Yes
---------------
Jacob Skaria

"Brad" wrote:

I have a program that filters a table and should sum the visible rows in a
particular column and store the results in an array variable. This occurs
inside a for loop. Everything works fine except for the sum part. I'm not
sure what the correct code should be to accomplish this. Here is what I have,
which does not work. Is there a suitable replacement for this?
With workbooks("Data").Sheets("Sheet1").ListObjects("tb lData")

iLoop2PrevWeek(iLoopCount) = WorksheetFunction.Sum _
(.ListColumn(4).DataBodyRange.SpecialCells(xlCellT ypeVisible))

End with



All times are GMT +1. The time now is 06:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com