Thread: subtotal
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default subtotal

This will sum the E column for example
This formula will be two cell below the last value

Range("E" & Rows.Count).End(xlUp).Offset(2, 0).FormulaR1C1 = "=SUM(R1C:R[-2]C)"

You can make a loop through your columns


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"projectside" wrote in message ...

i need to run a code that would subtotal my spreadsheet. my problem is
that I won't know what my real last cell is because the spreadsheet
will have different number of data everytime i run the report.

i need the subtotal to be in column E through L and the row number will
be whatever the real last cell is.

please help


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/