I am very confused .... from the code it looks like you are writing to an Excel spreadsheet even though you talk about a table.
From the code, it looks like there is a lot more code that is not posted.
However, given your data, I set up a spreadsheet and wrote some EXCEL code to add a formula row.
Code:
Sub YourSubName()
Const StartDataRow As Integer = 3 'first row for sum function is always this number
Dim EndDataRow As Integer
Dim LastDataColumn As Integer
Dim FormulaRow As Integer
Dim k As Integer 'kounter
Dim SumRow As String
Dim SumCol As String
'last column
Range("B2").Select
Selection.End(xlToRight).Select
LastDataColumn = ActiveCell.Cells.Column
'last data row
Range("B2").Select
Selection.End(xlDown).Select
EndDataRow = ActiveCell.Cells.Row
' formula row number
FormulaRow = EndDataRow + 1
' loop through columns
For k = 2 To LastDataColumn 'first column will be "B", then increment as k increments
SumRow = Chr(64 + k) & StartDataRow
SumCol = Chr(64 + k) & EndDataRow
ActiveSheet.Cells(FormulaRow, k).Formula = "=SUM(" & SumRow & ":" & SumCol & ")"
Next
End Sub
Your task is to adapt this code to work in your dB.....
(its been a long time (years) since I've done any coding in Excel! Whew!)
Good luck with your project...