Ross has attended:
Excel VBA Intro Intermediate course
AutoSum
Hi
After running a macro i want to put a sum at the bottom but the problem is that the area could change each time
the current formula is
range("D7").Select
Selection.End(xlDown).Select
Selection.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = "=SUM(R[-12]C:R[-1]C)"
This will only sum 12 Rows. The amount of row will vary
how can tell how many rows it needs to Sum.
RE: AutoSum
Hi Ross, have a look in our commented code for how we used currentregion.rows.count and then use that to cope with your fluctuating numbers of rows.
Hope this helps,
Anthony