sum a specific range
You could paste this macro into a module in your workbook, make sure the
spreadsheet in question is active then run this macro. I think it is what
you want.
Tom
Sub InsertTotals()
Dim dblStart As Double
Dim dblCounter As Double
For dblCounter = 1 To ActiveSheet.UsedRange _
..Rows(ActiveSheet.UsedRange.Rows.Count).Row
If ActiveSheet.Cells(dblCounter, 1).Value = "NAME" Then
dblStart = dblCounter
End If
If ActiveSheet.Cells(dblCounter, 1).Value = "END BALANCE" Then
ActiveSheet.Cells(dblCounter, 3).Value = _
"=sum(C" & dblStart & ":c" & dblCounter - 1 & ")"
End If
Next dblCounter
End Sub
|