Moonbeam111
Board Regular
- Joined
- Sep 24, 2018
- Messages
- 78
- Office Version
- 365
- 2010
I have a worksheet and in that worksheet I basically need to add the value of every nth cell onto a different cell that has the total of all those cells.
So in my case, I would like to be able to add every 9th cell in column O starting with Range("O15") continuing all the way down to Range("O1002) and adding the total of all those numbers to Range("H2").
I have a formula to do this that I put in cell H2:
But I would like to be able to do this in VBA because of other things I'm doing to my workbook and I'm not sure where to start.
Any assistance would be much appreciated.
So in my case, I would like to be able to add every 9th cell in column O starting with Range("O15") continuing all the way down to Range("O1002) and adding the total of all those numbers to Range("H2").
I have a formula to do this that I put in cell H2:
Excel Formula:
=SUM(IF(MOD(ROW($O$1:$O$1002)-6,9)=0,$O$1:$O$1002,0))
But I would like to be able to do this in VBA because of other things I'm doing to my workbook and I'm not sure where to start.
Any assistance would be much appreciated.