Hi,
I recorded this sumif in VBA, but know I am trying to figure out how to tie in the last row reference in place of the 27. Can somebody help with this?
=SUMIF($AR$2:$AR$27,$AR29,AS$2:AS$27)
FormulaR1C1 = "=SUMIF(R2C44:R27C44,RC44,R2C:R27C)"
Hi,
I recorded this sumif in VBA, but know I am trying to figure out how to tie in the last row reference in place of the 27. Can somebody help with this?
=SUMIF($AR$2:$AR$27,$AR29,AS$2:AS$27)
FormulaR1C1 = "=SUMIF(R2C44:R27C44,RC44,R2C:R27C)"
Last edited by VBA Noob; 03-20-2009 at 05:59 PM.
HTH
Regards, Jeff
Last row reference?
Entia non sunt multiplicanda sine necessitate
Yes, my macro will add rows at each change in another value in the data so my sumif might be last row 27 one time and then the next time it could be last row 53.
One way
VBA Noob![]()
Dim LastRow As Long LastRow = Cells(Rows.Count, "A").End(xlUp).Row ActiveCell.Formula = _ "=SUMIF($AR$2:$AR$" & LastRow & ",$AR29,AS$2:AS$" & LastRow & ")"
_________________________________________
![]()
![]()
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
Thank you...that's exactly it
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks