There are 42 way to do this. I tried to think of one whose logic was simple enough for a complete beginner to understand, so that you can change it if you aver need to rearrange the table.
I set it up so that if you DoubleClick a cell in column C inside the table, it will compute all the totals. If you DoubleClick a Cell in Column F, inside the table, it will erase all the Totals.
Place all this code in the Worksheet Code Page. RightClick on the Sheet Tab and select "View Code" to open that Code Page.
Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range(Range("F10"), Cells(Rows.Count, "F").End(xlUp))) _
Is Nothing Then
Aimatarv_ClearSubtotals 'Edit to match name of Sub
Cancel = True
End If
If Not Intersect(Target, Range(Range("C10"), Cells(Rows.Count, "C").End(xlUp))) _
Is Nothing Then
VBAX_SamT_Aimatarv_SubTotaling 'Edit to match name of Sub
Cancel = True
End If
End Sub
Sub VBAX_SamT_Aimatarv_SubTotaling()
'For help see: http://www.vbaexpress.com/forum/showthread.php?55189
Dim Rw As Long
Dim RateTotal As Double
For Rw = 10 To Cells(10, "B").End(xlDown).Row
If Cells(Rw, "A") = "" Then
If Cells(Rw, "C") <> 0 Then
RateTotal = RateTotal + Cells(Rw, "C")
Else
Cells(Rw, "C") = RateTotal
Cells(Rw, "F") = RateTotal + Cells(Rw, "E")
End If
Else
RateTotal = 0
End If
Next Rw
End Sub
Sub Aimatarv_ClearSubtotals()
'For help see: http://www.vbaexpress.com/forum/showthread.php?55189
Dim Rw As Long
Dim RateTotal As Double
For Rw = 11 To Cells(10, "B").End(xlDown).Row
If Cells(Rw, "A") <> "" Then
Cells(Rw - 1, "C").ClearContents
Cells(Rw - 1, "F").ClearContents
End If
Next Rw
Cells(Rw, "C").ClearContents
Cells(Rw, "F").ClearContents
End Sub