View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] seanryanie@yahoo.co.uk is offline
external usenet poster
 
Posts: 73
Default Cumulative Column when using Sub Totals Q

I have the Code below that places a Formula in Cells L13 & L14, then copies the formula in L14 down to last active Row. Essentially this produces a Running Total

How can I adjust this, if I have Sub Total's inserted, instead of a Running total just for the Sub Total Rows, its a Running Total of all Rows?

Sub CopyFormula()
Dim LastRow As Long

Sheets("Report").Select
Range("L13").Select
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("L14").Select
ActiveCell.FormulaR1C1 = "=RC[-1]+R[-1]C"

LastRow = Cells.Find(What:="*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Range("L14:L" & LastRow).FillDown
Range("A1").Select


End Sub