Hello,
Kindly assist me with a macro for summing up say 7 consecutive cells in a column, and then sum up next 7 consecutive cells, etc for say 1000 rows (1000 cells in a column).
Thanks.
Hello,
Kindly assist me with a macro for summing up say 7 consecutive cells in a column, and then sum up next 7 consecutive cells, etc for say 1000 rows (1000 cells in a column).
Thanks.
Hi
Copy and paste this macro into a Module in your Workbook and run it.
The Macro works on values stored in column A from row 1 to 1000. You may need to change the column and row numbers to suit your needs.
Sub Macro1()
'
' Macro1 Macro
'
'
For Count = 1 To 1000
Range("B" & Count + 6).Select
ActiveCell.FormulaR1C1 = "=SUM(R[-6]C[-1]:RC[-1])"
Count = Count + 6
Next Count
End Sub
Good luck.
Tony
Putting =SUM(A1:A7) in a B1 and dragging down to B1000 will do that.
Please Login or Register to view this content.
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
Thanks so much. Works but how do I now consolidate the data leaving out the blank spaces?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks