Ok, I thought I was being smart and have produced the following code:
Sub total()
Sheets("Summary Sheet").Select
Range("c3").Select
m = 0
n = 0
o = 0
p = 0
mins = 0
Do While ActiveCell.Offset(m, n) <> ""
Do While ActiveCell.Offset(m, n) <> ""
Sheets("Summary Sheet").Select
Range("c3").Select
mins = mins + ActiveCell.Offset(m, n).Value
m = m + 4
Loop
Sheets("Tables").Select
Range("b3").Select
ActiveCell.Offset(o, p).Value = mins
mins = 0
o = o + 1
m = 1
If o = 2 Then
o = 0
m = 0
n = n + 1
p = p + 1
Sheets("Summary Sheet").Select
Range("c3").Select
Else
Sheets("Summary Sheet").Select
Range("c3").Select
Loop
End Sub
But it's kicking out a loop failure, because it says it can't have a loop without a 'Do'. However, I have 2 'Do's and 2 'Loop's so I don't see why it's not working.
The code is supposed to add up the values in (n) number of rows (each 4 rows apart) and paste that value into a cell on a different sheet, then repeat, offset down one row, then repeat on the original row series but offset one across... etc and so on, until it runs out of values to add and paste.
Any help would be much appreciated...
fd.
Bookmarks