Hi
got this from mikerickson
tell application "Microsoft Excel"
activate
accept all changes active workbook
set columnToTest to range "G:G" of active sheet -- adjust to last column to be added
set cellCount to count of cells of columnToTest
set usedRanges to used range of worksheet object of columnToTest
set rowsCount to first row index of (get end cell cellCount of columnToTest direction toward the top)
set lastCol to (first column index of usedRanges) + (count of columns of usedRanges)
set formulaCells to get resize (cell 1 of column (lastCol) of active sheet) row size rowsCount
set formula r1c1 of formulaCells to ¬
"=SUM(RC[-7]:RC[-1])" --[-7] number of consecutive columns in a row to be added, the formula will apply to all used rows
end tell
hope it gives you a start
as to header row you can try this
set value of cell 1 of range "1:1" to "whatever" as text
regards
bills