ok basically, I have 7 blocks 1 per day all exactly the same with a block to hold the weekly totals for each category.
rp rf wi tp em total
n u n u n u n u n u n u
1 1 1 1 1 1 1 1 1 1 5 5
2 2 2 2 2 2 2 2 2 2 10 10
_________________________
3 3 3 3 3 3 3 3 3 3 15 15
the code I have updates all the daily ones no problems, but when it updates the weekly one is only updating the first four columns, I know I must be doing something stupid, and every time I have tried to get the columns to total at the bottom, I get in an endless loop. Any help would be appreciated.
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal target As Range)
If Left(ActiveSheet.Name, 4) = "Week" Then
If target.Row > 14 Then
Select Case target.Column
Case 16, 18, 20, 22, 24
ActiveSheet.Cells(ActiveCell.Row, 26).FormulaR1C1 = "=rc[-10]+rc[-8]+rc[-6]+rc[-4]+rc[-2]"
ActiveSheet.Cells(ActiveCell.Row, 2).FormulaR1C1 = "=rc[14]+rc[28]+rc[42]+rc[56]+rc[70]+rc[84]+rc[98]"
Case 17, 19, 21, 23, 25
ActiveSheet.Cells(ActiveCell.Row, 27).FormulaR1C1 = "=rc[-10]+rc[-8]+rc[-6]+rc[-4]+rc[-2]"
ActiveSheet.Cells(ActiveCell.Row, 3).FormulaR1C1 = "=rc[14]+rc[28]+rc[42]+rc[56]+rc[70]+rc[84]+rc[98]"
Case 30, 32, 34, 36, 38
ActiveSheet.Cells(ActiveCell.Row, 40).FormulaR1C1 = "=rc[-10]+rc[-8]+rc[-6]+rc[-4]+rc[-2]"
ActiveSheet.Cells(ActiveCell.Row, 4).FormulaR1C1 = "=rc[14]+rc[28]+rc[42]+rc[56]+rc[70]+rc[84]+rc[98]"
Case 31, 33, 35, 37, 39
ActiveSheet.Cells(ActiveCell.Row, 41).FormulaR1C1 = "=rc[-10]+rc[-8]+rc[-6]+rc[-4]+rc[-2]"
ActiveSheet.Cells(ActiveCell.Row, 5).FormulaR1C1 = "=rc[14]+rc[28]+rc[42]+rc[56]+rc[70]+rc[84]+rc[98]"
Case 44, 46, 48, 50, 52
ActiveSheet.Cells(ActiveCell.Row, 54).FormulaR1C1 = "=rc[-10]+rc[-8]+rc[-6]+rc[-4]+rc[-2]"
ActiveSheet.Cells(ActiveCell.Row, 6).FormulaR1C1 = "=rc[14]+rc[28]+rc[42]+rc[56]+rc[70]+rc[84]+rc[98]"
Case 45, 47, 49, 51, 53
ActiveSheet.Cells(ActiveCell.Row, 55).FormulaR1C1 = "=rc[-10]+rc[-8]+rc[-6]+rc[-4]+rc[-2]"
ActiveSheet.Cells(ActiveCell.Row, 7).FormulaR1C1 = "=rc[14]+rc[28]+rc[42]+rc[56]+rc[70]+rc[84]+rc[98]"
Case 58, 60, 62, 64, 66
ActiveSheet.Cells(ActiveCell.Row, 68).FormulaR1C1 = "=rc[-10]+rc[-8]+rc[-6]+rc[-4]+rc[-2]"
ActiveSheet.Cells(ActiveCell.Row, 8).FormulaR1C1 = "=rc[14]+rc[28]+rc[42]+rc[56]+rc[70]+rc[84]+rc[98]"
Case 59, 61, 63, 65, 67
ActiveSheet.Cells(ActiveCell.Row, 69).FormulaR1C1 = "=rc[-10]+rc[-8]+rc[-6]+rc[-4]+rc[-2]"
ActiveSheet.Cells(ActiveCell.Row, 9).FormulaR1C1 = "=rc[14]+rc[28]+rc[42]+rc[56]+rc[70]+rc[84]+rc[98]"
Case 72, 74, 76, 78, 80
ActiveSheet.Cells(ActiveCell.Row, 82).FormulaR1C1 = "=rc[-10]+rc[-8]+rc[-6]+rc[-4]+rc[-2]"
ActiveSheet.Cells(ActiveCell.Row, 10).FormulaR1C1 = "=rc[14]+rc[28]+rc[42]+rc[56]+rc[70]+rc[84]+rc[98]"
Case 73, 75, 77, 79, 81
ActiveSheet.Cells(ActiveCell.Row, 83).FormulaR1C1 = "=rc[-10]+rc[-8]+rc[-6]+rc[-4]+rc[-2]"
ActiveSheet.Cells(ActiveCell.Row, 11).FormulaR1C1 = "=rc[14]+rc[28]+rc[42]+rc[56]+rc[70]+rc[84]+rc[98]"
Case 86, 88, 90, 92, 94
ActiveSheet.Cells(ActiveCell.Row, 96).FormulaR1C1 = "=rc[-10]+rc[-8]+rc[-6]+rc[-4]+rc[-2]"
ActiveSheet.Cells(ActiveCell.Row, 12).FormulaR1C1 = "=rc[14]+rc[28]+rc[42]+rc[56]+rc[70]+rc[84]+rc[98]"
Case 87, 89, 91, 93, 95
ActiveSheet.Cells(ActiveCell.Row, 97).FormulaR1C1 = "=rc[-10]+rc[-8]+rc[-6]+rc[-4]+rc[-2]"
ActiveSheet.Cells(ActiveCell.Row, 13).FormulaR1C1 = "=rc[14]+rc[28]+rc[42]+rc[56]+rc[70]+rc[84]+rc[98]"
Case 100, 102, 104, 106, 108
ActiveSheet.Cells(ActiveCell.Row, 110).FormulaR1C1 = "=rc[-10]+rc[-8]+rc[-6]+rc[-4]+rc[-2]"
Case 101, 103, 105, 107, 109
ActiveSheet.Cells(ActiveCell.Row, 111).FormulaR1C1 = "=rc[-10]+rc[-8]+rc[-6]+rc[-4]+rc[-2]"
End Select
End If
End If
End Sub