uncleslinky
New Member
- Joined
- Mar 31, 2009
- Messages
- 47
hi there
Is there a way to change the code below so that when I sum data excel doesn't go to row "30000"
If possible I would like it to stop at the last cell of data in cell A
As you can see I have done this for the last line of code where it copies down the formula, however I can't figure out how to do this on the 3rd line of code
Thanks
Is there a way to change the code below so that when I sum data excel doesn't go to row "30000"
If possible I would like it to stop at the last cell of data in cell A
Code:
Dim r As Long
r = Cells(Rows.Count, "A").End(xlUp).Row
ActiveCell.FormulaR1C1 = "=SUMIF(R2C3:R30000C3,RC3,R2C[-12]:R30000C[-12])"
Selection.AutoFill Destination:=Range("U2:U" & r)
As you can see I have done this for the last line of code where it copies down the formula, however I can't figure out how to do this on the 3rd line of code
Thanks