View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tim Zych[_2_] Tim Zych[_2_] is offline
external usenet poster
 
Posts: 41
Default Autosum variable range in macro

Another way:

ActiveCell.FormulaR1C1 = "=SUM(R1C:R[-1]C)"


"Eric Dreshfield" wrote in message
...
I would like to be able to add programming to a macro that
mimics the AutoSum key....for example, if cells A1 through
A10 have values and the active cell is A11, I want the
macro to create the =Sum(a1:a10) formula, but I do not
want the cell references hard coded, as the number of rows
will vary each time this process is run. Any suggestions ?

Thanks !