I found this thread from 2003:
Dan
_______________________________________________
Newsgroups: microsoft.public.excel.programming
From: "Florian Müller" <
[email protected]>
Date: Fri, 4 Apr 2003 11:59:52 +0200
Local: Fri, Apr 4 2003 2:59 am
Subject: Sum every fourth row.
Hi!
I've got an Spreadsheet where i'd like to sum every fourth row,
starting
with the cell G5.
so:
SUM(G5+G9+G13+...+Gn)
SUM(H5+H9+H13+...+Hn)
..
..
..
SUM(Col5+Col9+...+Coln)
The problem is, that i have about 1000 records, so it would much work
to
click on every cell i need.
Which VBA code do i need?
Thanx
Flo
Newsgroups: microsoft.public.excel.programming
From: "Monika Weber" <
[email protected]>
Date: Fri, 4 Apr 2003 12:17:04 +0200
Local: Fri, Apr 4 2003 3:17 am
Subject: Re: Sum every fourth row.
Hi Flo,
maybe something like this can help you:
Sub test()
Dim i As Integer
Dim dblSum As Double
For i = 1 To ActiveSheet.Range("G1:G20"). _
count Step 4
dblSum = dblSum + Cells(1, i)
Next i
MsgBox dblSum
End Sub
--
Es liebs Grüessli
Monika Weber [Microsoft MVP für Excel]
http://www.jumper.ch /
http://excel.codebooks.de
Newsgroups: microsoft.public.excel.programming
From: "Arvi Laanemets" <
[email protected]>
Date: Fri, 4 Apr 2003 13:36:39 +0300
Local: Fri, Apr 4 2003 3:36 am
Subject: Re: Sum every fourth row.
Hi/Hallo
Ich denke dass hier ist wofür Du suchst (n=100)!
=SUMPRODUCT((MOD(ROW(G5:G100)-1;4)=0)*G5:G100)
Arvi Laanemets
Newsgroups: microsoft.public.excel.programming
From: Alan Beban <
[email protected]>
Date: Fri, 04 Apr 2003 10:44:42 -0800
Local: Fri, Apr 4 2003 11:44 am
Subject: Re: Sum every fourth row.
A different approach for any who use the functions from the file at
http://home.pacbell.net/beban:
=SUM(ArrayAlternates(ArrayAlternates(G5:G100)))
Alan Beban
Newsgroups: microsoft.public.excel.programming
From: "orthnerk" <
[email protected]>
Date: Fri, 4 Apr 2003 13:28:11 -0800
Local: Fri, Apr 4 2003 2:28 pm
Subject: Sum every fourth row.
have you looked at maybe the subtotals function. Is the
data the same for each of the four rows you will be
summing? Subtotals work like a charm and they are quickly
removable if your data changes.