Sum function that add every 13th row...
In cell put =Sum13(a18:a226)
It will count every 13th row from start of given range.
Function Sum13(ByVal rng As Range)
Dim sum As Double
Dim row As Integer
Mysum = 0
For row = 1 To rng.Count Step 13
Mysum = Mysum + rng(row)
Next row
Sum13 = Mysum
End Function
"Greg" wrote:
That works ok but is there some kind of function, so I can place it a cell
and copy and paste it accross many cells? Please advise.
Thanks!!
"Toppers" wrote:
Sub Sum13
Dim sum as Double
Dim row as integer, col as integer
MySum =0
col=3 '<=== change to suit
For row=18 to 226 step 13
Mysum=Mysum+cells(row,col)
next row
msgbox Mysum
end Sub
HTH
"Greg" wrote:
Is it possible to sum a column starting from row 18 and ending at row 226
only summing every 13th row. For example, sum the following rows
18,31,44,57,70 ... 226? Please help!!
Thanks in advance!! :)
|