View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Lizz45ie[_8_] Lizz45ie[_8_] is offline
external usenet poster
 
Posts: 1
Default Using Subtotals in VBA


Hello,
I'm trying to sub-totals in macro where the last row will vary.
Currently I'm using the code that the Macro recorder recorded but it
doesn't work if there are more rows than what's in the macro. The
macro recorded:

ActiveCell.FormulaR1C1 = "=SUBTOTAL(9,R[2]C:R[1068]C)"

I've tried ActiveCell.FormulaR1C1 = "=SUBTOTAL(9,R[-" & C3 &
"]C:R[-1]C)" but it doesn't return totals. My subtotals are at the top
of my columns - I don't if that makes a difference.

Please help. :


--
Lizz45ie
------------------------------------------------------------------------
Lizz45ie's Profile: http://www.excelforum.com/member.php...o&userid=23410
View this thread: http://www.excelforum.com/showthread...hreadid=482977