PDA

View Full Version : Subtotal in VBA with counta function



nirvehex
09-03-2014, 02:14 PM
Hi,

How would I put this function into a VBA code that looks at column A and puts this function in the cell after the very last cell with any data in it. Assume there are no blanks within the data in column A.

So I want to find the last row of data in column A and run this formula in the next row down. Furthermore how do I make the ending cell (a14) so it automatically runs the formula to the last cell with data in it.



=SUBTOTAL(103,'1 yr of PO''s'!$A$2:$A$14)


Thanks!

Bob Phillips
09-03-2014, 02:26 PM
Range("A2").End(xlDown).Offset(1, 0).FormulaR1C1 = "=SUBTOTAL(103, '1 yr of PO''s'!R2C:R[-1]C)"