View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] gi_stewart@yahoo.com is offline
external usenet poster
 
Posts: 2
Default Sum columns of data in vba

Hi,

I had a table of data, starting on row 6, with 4 columns and was using
this code to sum each column in a total row:

For i = 1 To 4
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "=SUM(R6C:R[-1]C)"
Next i

I now have 4 more tables on the same worksheet, starting on rows that
can vary. Is there a way of modifying the above code to enter total
rows for each of the new tables? Thanks.